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