From e1b4852ff0e8f514b99690ea5ec7ed5a08bbc878 Mon Sep 17 00:00:00 2001 From: "lucas.taia" Date: Tue, 1 Nov 2022 18:08:18 +0000 Subject: [PATCH] fixes bug#AL-1536 qua: dev:Lucas git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@115121 d1611594-4594-4d17-8e1d-87c2c4800839 --- src/db/migration/V20221017_1519__AL-1536.sql | 10 +++++++++- src/db/migration/V20221101_1459__AL-1536.sql | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/db/migration/V20221101_1459__AL-1536.sql diff --git a/src/db/migration/V20221017_1519__AL-1536.sql b/src/db/migration/V20221017_1519__AL-1536.sql index 1f6bf44d4..7143ae9ca 100644 --- a/src/db/migration/V20221017_1519__AL-1536.sql +++ b/src/db/migration/V20221017_1519__AL-1536.sql @@ -6,6 +6,14 @@ begin exception when column_exists then null; end; / +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (NUMDAV VARCHAR2(15) )'; + exception when column_exists then null; +end; +/ declare column_exists exception; pragma exception_init (column_exists , -01430); @@ -39,7 +47,7 @@ BEGIN FOR EMP IN (SELECT EMPRESA_ID FROM EMPRESA WHERE ACTIVO = 1 AND EMPRESA_ID > 0) LOOP BEGIN - SELECT SEQUENCE_NAME INTO nomSeq from DBA_SEQUENCES where SEQUENCE_owner = (select user from dual) AND SEQUENCE_NAME like 'FOLIO_SISTEMA_DAV_' || EMP.EMPRESA_ID || '_SEQ%'; + SELECT SEQUENCE_NAME INTO nomSeq from user_SEQUENCES where SEQUENCE_NAME like 'FOLIO_SISTEMA_DAV_' || EMP.EMPRESA_ID || '_SEQ%'; EXCEPTION WHEN NO_DATA_FOUND THEN EXECUTE IMMEDIATE 'CREATE SEQUENCE ' || 'FOLIO_SISTEMA_DAV_' || EMP.EMPRESA_ID || '_SEQ MINVALUE 1 MAXVALUE 999999999 INCREMENT BY 1 START WITH 1 ORDER NOCACHE CYCLE'; END; diff --git a/src/db/migration/V20221101_1459__AL-1536.sql b/src/db/migration/V20221101_1459__AL-1536.sql new file mode 100644 index 000000000..f04280c7e --- /dev/null +++ b/src/db/migration/V20221101_1459__AL-1536.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BPE ADD (NUMDAV VARCHAR2(15) )'; + exception when column_exists then null; +end; \ No newline at end of file