From b733e6d82735296bd5bec1f8e73e4979b418ab28 Mon Sep 17 00:00:00 2001 From: valdir Date: Thu, 19 Mar 2020 20:39:47 +0000 Subject: [PATCH] 0018200: Espec Melhorias no cadastro de Clientes bug#18200 dev:thiago qua:debora git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@100840 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../migration/V20200316_1522__mantis18200.sql | 31 +++++++++++++++++++ .../migration/V20200316_1522__mantis18200.sql | 18 +++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/db/migration/V20200316_1522__mantis18200.sql create mode 100644 src/db/postgresql/migration/V20200316_1522__mantis18200.sql diff --git a/src/db/migration/V20200316_1522__mantis18200.sql b/src/db/migration/V20200316_1522__mantis18200.sql new file mode 100644 index 000000000..6ce827d06 --- /dev/null +++ b/src/db/migration/V20200316_1522__mantis18200.sql @@ -0,0 +1,31 @@ +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 'ALTER TABLE CLIENTE ADD (ISESTRANGEIRO NUMBER(1,0))'; + 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 'ALTER TABLE CLIENTE_DIRECCION ADD (DESCPAIS VARCHAR2(60 BYTE)) '; + 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/V20200316_1522__mantis18200.sql b/src/db/postgresql/migration/V20200316_1522__mantis18200.sql new file mode 100644 index 000000000..6352b142a --- /dev/null +++ b/src/db/postgresql/migration/V20200316_1522__mantis18200.sql @@ -0,0 +1,18 @@ +DO $$ +BEGIN + ALTER TABLE CLIENTE ADD (ISESTRANGEIRO NUMBER(1,0)); + EXCEPTION + WHEN OTHERS THEN NULL; + WHEN unique_violation THEN NULL; +END +$$; +/ +DO $$ +BEGIN + ALTER TABLE CLIENTE_DIRECCION ADD (DESCPAIS VARCHAR2(60 BYTE)); + EXCEPTION + WHEN OTHERS THEN NULL; + WHEN unique_violation THEN NULL; +END +$$; +/