From 6a062ef7824e65cd6c77bd722b9698a8b94ad8e0 Mon Sep 17 00:00:00 2001 From: "thiago.clemente" Date: Fri, 8 May 2020 20:53:11 +0000 Subject: [PATCH] bug#19163 dev: valdir qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@101524 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../migration/V20200507_1810__mantis19163.sql | 23 +++++++++++++++++++ .../migration/V20200507_1810__mantis19163.sql | 17 ++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/db/migration/V20200507_1810__mantis19163.sql create mode 100644 src/db/postgresql/migration/V20200507_1810__mantis19163.sql diff --git a/src/db/migration/V20200507_1810__mantis19163.sql b/src/db/migration/V20200507_1810__mantis19163.sql new file mode 100644 index 000000000..bec9be8de --- /dev/null +++ b/src/db/migration/V20200507_1810__mantis19163.sql @@ -0,0 +1,23 @@ +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 PUNTO_VENTA ADD INDQRCODECATRACARODEAN13 NUMBER(1, 0)'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'update constante set activo = 0 where NOMBCONSTANTE = ''QRCODE_CATRACA_RODOVIARIA_EAN13'''; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20200507_1810__mantis19163.sql b/src/db/postgresql/migration/V20200507_1810__mantis19163.sql new file mode 100644 index 000000000..734b7fc6b --- /dev/null +++ b/src/db/postgresql/migration/V20200507_1810__mantis19163.sql @@ -0,0 +1,17 @@ +DO $$ +BEGIN + ALTER TABLE PUNTO_VENTA ADD INDQRCODECATRACARODEAN13 NUMBER(1, 0); + EXCEPTION + WHEN OTHERS THEN NULL; + WHEN unique_violation THEN NULL; +END +$$; +/ +DO $$ +BEGIN + update constante set activo = 0 where NOMBCONSTANTE = 'QRCODE_CATRACA_RODOVIARIA_EAN13'; + EXCEPTION + WHEN OTHERS THEN NULL; + WHEN unique_violation THEN NULL; +END +$$; \ No newline at end of file