From 4ccf28dfacc72416a0ea2437923c84effecf7f34 Mon Sep 17 00:00:00 2001 From: "valdir.cordeiro" Date: Tue, 31 Jan 2023 10:41:12 -0300 Subject: [PATCH] bug#al-2105 Aguia Branca - GLPI 60105 - [PROJETO] - ADM - ERRO CADASTRO DE NOVAS ESTACOES COM INTEGRACAO SITEF dev: qua: --- pom.xml | 2 +- src/db/migration/V20230131_1017__AL2105.sql | 63 +++++++++++++++++++ .../migration/V20230131_1017__AL2105.sql | 22 +++++++ 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 src/db/migration/V20230131_1017__AL2105.sql create mode 100644 src/db/postgresql/migration/V20230131_1017__AL2105.sql diff --git a/pom.xml b/pom.xml index 3e0249f45..4108b4487 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 br.com.rjconsultores Flyway - 1.0.18 + 1.0.19 diff --git a/src/db/migration/V20230131_1017__AL2105.sql b/src/db/migration/V20230131_1017__AL2105.sql new file mode 100644 index 000000000..e765ed347 --- /dev/null +++ b/src/db/migration/V20230131_1017__AL2105.sql @@ -0,0 +1,63 @@ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'UPDATE ESTACION_SITEF SET TIPO_INTEGRACAO = ''SITEF'' WHERE TIPO_INTEGRACAO = ''Sitef'''; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'UPDATE ESTACION_SITEF SET TIPO_INTEGRACAO = ''PAYGO'' WHERE TIPO_INTEGRACAO = ''Paygo'''; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'UPDATE ESTACION_SITEF SET TIPO_INTEGRACAO = ''GRANITO'' WHERE TIPO_INTEGRACAO = ''Granito'''; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'UPDATE ESTACION_SITEF SET TIPO_INTEGRACAO = ''ADYEN'' WHERE TIPO_INTEGRACAO = ''Adyen'''; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20230131_1017__AL2105.sql b/src/db/postgresql/migration/V20230131_1017__AL2105.sql new file mode 100644 index 000000000..c2d439abc --- /dev/null +++ b/src/db/postgresql/migration/V20230131_1017__AL2105.sql @@ -0,0 +1,22 @@ +DO $$ +BEGIN + UPDATE ESTACION_SITEF SET TIPO_INTEGRACAO = 'SITEF' WHERE TIPO_INTEGRACAO = 'Sitef'; +END +$$; +/ +DO $$ +BEGIN + UPDATE ESTACION_SITEF SET TIPO_INTEGRACAO = 'PAYGO' WHERE TIPO_INTEGRACAO = 'Paygo'; +END +$$; +/DO $$ +BEGIN + UPDATE ESTACION_SITEF SET TIPO_INTEGRACAO = 'GRANITO' WHERE TIPO_INTEGRACAO = 'Granito'; +END +$$; +/DO $$ +BEGIN + UPDATE ESTACION_SITEF SET TIPO_INTEGRACAO = 'ADYEN' WHERE TIPO_INTEGRACAO = 'Adyen'; +END +$$; +