From ef405723874586d6566ed62fa1c01e5513c32e48 Mon Sep 17 00:00:00 2001 From: fabio Date: Mon, 18 Oct 2021 11:46:59 +0000 Subject: [PATCH] fixes bug#23073 dev: wallace qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@109166 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../migration/V20210914_1522__Mantis23073.sql | 21 +++++++++++++++++++ .../migration/V20210914_1522__Mantis23073.sql | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/db/migration/V20210914_1522__Mantis23073.sql create mode 100644 src/db/postgresql/migration/V20210914_1522__Mantis23073.sql diff --git a/src/db/migration/V20210914_1522__Mantis23073.sql b/src/db/migration/V20210914_1522__Mantis23073.sql new file mode 100644 index 000000000..a07cb2c15 --- /dev/null +++ b/src/db/migration/V20210914_1522__Mantis23073.sql @@ -0,0 +1,21 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE MONEDA ADD (SIMBOLO VARCHAR2(3))'; + exception when column_exists then null; +end; +/ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'UPDATE MONEDA SET SIMBOLO = ''R$'' WHERE MONEDA_ID = 1 '; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; +/ \ No newline at end of file diff --git a/src/db/postgresql/migration/V20210914_1522__Mantis23073.sql b/src/db/postgresql/migration/V20210914_1522__Mantis23073.sql new file mode 100644 index 000000000..a07cb2c15 --- /dev/null +++ b/src/db/postgresql/migration/V20210914_1522__Mantis23073.sql @@ -0,0 +1,21 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE MONEDA ADD (SIMBOLO VARCHAR2(3))'; + exception when column_exists then null; +end; +/ +declare + dup_val_on_index exception; + except_02291 exception; + + pragma exception_init (dup_val_on_index , -00001); + pragma exception_init (except_02291 , -02291); +begin + execute immediate 'UPDATE MONEDA SET SIMBOLO = ''R$'' WHERE MONEDA_ID = 1 '; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; +/ \ No newline at end of file