From 8d0a7d573c1d85f1674c8592d0460805921c77ef Mon Sep 17 00:00:00 2001 From: valdevir Date: Thu, 13 May 2021 13:51:12 +0000 Subject: [PATCH] fixes bug#22115 qua: dev:Valdir git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@106664 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../migration/V20210705_1412__mantis22115.sql | 31 +++++++++++++++++++ .../migration/V20210705_1412__mantis22115.sql | 14 +++++++++ 2 files changed, 45 insertions(+) create mode 100644 src/db/migration/V20210705_1412__mantis22115.sql create mode 100644 src/db/postgresql/migration/V20210705_1412__mantis22115.sql diff --git a/src/db/migration/V20210705_1412__mantis22115.sql b/src/db/migration/V20210705_1412__mantis22115.sql new file mode 100644 index 000000000..d0d249d47 --- /dev/null +++ b/src/db/migration/V20210705_1412__mantis22115.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 EMPRESA ADD INDICEIRK NUMBER(8,2) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 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 'INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (FUNCION_SISTEMA_SEQ.nextval, 1, ''ADM > RELATORIOS > OPERACIONAIS >> RELATORIO IRK'', + ''COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOIRK'', 1, + SYSDATE, -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/V20210705_1412__mantis22115.sql b/src/db/postgresql/migration/V20210705_1412__mantis22115.sql new file mode 100644 index 000000000..2913df23c --- /dev/null +++ b/src/db/postgresql/migration/V20210705_1412__mantis22115.sql @@ -0,0 +1,14 @@ +DO $$ +BEGIN + ALTER TABLE EMPRESA ADD INDICEIRK NUMBER(8,2); + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; +/ +DO $$ +BEGIN +INSERT INTO FUNCION_SISTEMA (FUNCIONSISTEMA_ID, SISTEMA_ID, NOMBFUNCION, DESCRUTA, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (nextval('funcion_sistema_seq'), 1, 'ADM > RELATORIOS > OPERACIONAIS >> RELATORIO IRK', + 'COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOIRK', 1, now(), 1); +END +$$;