From e7a7c1332be5e1fa26f79775d9bf961da97b67f5 Mon Sep 17 00:00:00 2001 From: Fabio Faria Date: Mon, 10 Oct 2022 13:55:03 -0300 Subject: [PATCH] sincronismo com codigo base --- src/db/migration/V20220610_1511__jira23.sql | 12 +++++-- .../V202206122_1522__mantis24590.sql | 15 -------- .../migration/V20220707_0927__mantis24591.sql | 8 ----- src/db/migration/V20220824_1535__AL1229.sql | 17 +++++++++ src/db/migration/V20220906_1511__jira38.sql | 11 ++++++ .../migration/V20220908_1100__jiraAL1340.sql | 16 +++++++++ src/db/migration/V20220913_0907__AL1226.sql | 35 +++++++++++++++++++ src/db/migration/V20220913_0908__AL1226.sql | 9 +++++ .../migration/V20220915_1100__jiraAL1379.sql | 23 ++++++++++++ src/db/migration/V20220916_1019__AL-1355.sql | 15 ++++++++ src/db/migration/V20221005_1432__AL1407.sql | 8 +++++ src/db/migration/V20221005_1649__al1331.sql | 6 ++++ src/db/migration/V20222709_1710__AL1328.sql | 7 ++++ .../migration/V20220908_1630__jira1340.sql | 17 +++++++++ .../migration/V20220913_0907__AL1226.sql | 21 +++++++++++ .../migration/V20220913_0908__AL1226.sql | 6 ++++ .../migration/V20220916_1019__AL-1355.sql | 15 ++++++++ .../migration/V20221005_1649__al1331.sql | 5 +++ .../migration/V20222709_1710__AL1328.sql | 5 +++ 19 files changed, 226 insertions(+), 25 deletions(-) delete mode 100644 src/db/migration/V202206122_1522__mantis24590.sql delete mode 100644 src/db/migration/V20220707_0927__mantis24591.sql create mode 100644 src/db/migration/V20220824_1535__AL1229.sql create mode 100644 src/db/migration/V20220906_1511__jira38.sql create mode 100644 src/db/migration/V20220908_1100__jiraAL1340.sql create mode 100644 src/db/migration/V20220913_0907__AL1226.sql create mode 100644 src/db/migration/V20220913_0908__AL1226.sql create mode 100644 src/db/migration/V20220915_1100__jiraAL1379.sql create mode 100644 src/db/migration/V20220916_1019__AL-1355.sql create mode 100644 src/db/migration/V20221005_1432__AL1407.sql create mode 100644 src/db/migration/V20221005_1649__al1331.sql create mode 100644 src/db/migration/V20222709_1710__AL1328.sql create mode 100644 src/db/postgresql/migration/V20220908_1630__jira1340.sql create mode 100644 src/db/postgresql/migration/V20220913_0907__AL1226.sql create mode 100644 src/db/postgresql/migration/V20220913_0908__AL1226.sql create mode 100644 src/db/postgresql/migration/V20220916_1019__AL-1355.sql create mode 100644 src/db/postgresql/migration/V20221005_1649__al1331.sql create mode 100644 src/db/postgresql/migration/V20222709_1710__AL1328.sql diff --git a/src/db/migration/V20220610_1511__jira23.sql b/src/db/migration/V20220610_1511__jira23.sql index 4434cdcc5..5fe4005b0 100644 --- a/src/db/migration/V20220610_1511__jira23.sql +++ b/src/db/migration/V20220610_1511__jira23.sql @@ -1,11 +1,19 @@ +ALTER TABLE EMPRESA_EMAIL_ECOMERCE DROP COLUMN TEXTOEMAIL; +ALTER TABLE EMPRESA_EMAIL_ECOMERCE DROP COLUMN TEXTOCUPOMEMBARQUE; + +ALTER TABLE EMPRESA_EMAIL_ECOMERCE add (TEXTOEMAIL CLOB); +ALTER TABLE EMPRESA_EMAIL_ECOMERCE add (TEXTOCUPOMEMBARQUE CLOB); + declare object_exists exception; except_00957 exception; pragma exception_init (object_exists , -01430); pragma exception_init (except_00957 , -00957); begin - execute immediate 'ALTER TABLE GP_PRICING ADD (VALOREXTRA NUMBER(7,2) )'; + execute immediate 'ALTER TABLE EMPRESA_EMAIL_ECOMERCE add (ANEXO1 CLOB)'; exception when object_exists then null; when except_00957 then null; -end; \ No newline at end of file +end; + + diff --git a/src/db/migration/V202206122_1522__mantis24590.sql b/src/db/migration/V202206122_1522__mantis24590.sql deleted file mode 100644 index 5a6b44f97..000000000 --- a/src/db/migration/V202206122_1522__mantis24590.sql +++ /dev/null @@ -1,15 +0,0 @@ -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 ORGAO_CANCELACION ADD INDIMPRIMECOMPROVANTETRANSFERENCIA NUMBER(1)'; - exception - when object_exists then null; - when except_01451 then null; - when except_01442 then null; -end; \ No newline at end of file diff --git a/src/db/migration/V20220707_0927__mantis24591.sql b/src/db/migration/V20220707_0927__mantis24591.sql deleted file mode 100644 index 76bf7a24f..000000000 --- a/src/db/migration/V20220707_0927__mantis24591.sql +++ /dev/null @@ -1,8 +0,0 @@ -declare - -begin - execute immediate 'ALTER TABLE ORGAO_CANCELACION RENAME COLUMN INDIMPRIMECOMPROVANTETRANSFERENCIA TO INDIMPRIMECOMPROVANTETRANS'; - exception - when others then null; - -end; \ No newline at end of file diff --git a/src/db/migration/V20220824_1535__AL1229.sql b/src/db/migration/V20220824_1535__AL1229.sql new file mode 100644 index 000000000..c80421b51 --- /dev/null +++ b/src/db/migration/V20220824_1535__AL1229.sql @@ -0,0 +1,17 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''EMITE_BPE_CONTINGENCIA_ERRO_SEFAZ'', ''EMITE_BPE_CONTINGENCIA_ERRO_SEFAZ'', ''false'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when dup_val_on_index then null; +end; +/ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''EMITE_BPE_CONT_SEFAZ_RET_INVALIDO'', ''EMITE_BPE_CONTINGENCIA_SEFAZ_RETORNO_INVALIDO'', ''false'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20220906_1511__jira38.sql b/src/db/migration/V20220906_1511__jira38.sql new file mode 100644 index 000000000..4434cdcc5 --- /dev/null +++ b/src/db/migration/V20220906_1511__jira38.sql @@ -0,0 +1,11 @@ +declare + object_exists exception; + except_00957 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE GP_PRICING ADD (VALOREXTRA NUMBER(7,2) )'; + exception + when object_exists then null; + when except_00957 then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20220908_1100__jiraAL1340.sql b/src/db/migration/V20220908_1100__jiraAL1340.sql new file mode 100644 index 000000000..d77214a9c --- /dev/null +++ b/src/db/migration/V20220908_1100__jiraAL1340.sql @@ -0,0 +1,16 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA ADD (SEQUENCIAROD NUMBER(10))'; + exception when column_exists then null; +end; +/ + +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE BOLETO ADD (SEQUENCIAROD NUMBER(10))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20220913_0907__AL1226.sql b/src/db/migration/V20220913_0907__AL1226.sql new file mode 100644 index 000000000..612b8880d --- /dev/null +++ b/src/db/migration/V20220913_0907__AL1226.sql @@ -0,0 +1,35 @@ +declare + dup_val_on_index exception; + except_00955 exception; + + pragma exception_init (except_00955 , -00955); + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'CREATE SEQUENCE "REDONDEO_ORGAOCONCEDENTE_SEQ" MINVALUE 1 MAXVALUE 999999999999999999 INCREMENT BY 1 START WITH 121 CACHE 20 NOORDER NOCYCLE NOKEEP NOSCALE GLOBAL'; + exception + when dup_val_on_index then null; + when except_00955 then null; +end; +/ +declare + dup_val_on_index exception; + except_00955 exception; + pragma exception_init (except_00955 , -00955); + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate + 'CREATE TABLE REDONDEO_ORGAOCONCEDENTE ( + REDONDEOORGAOCONCEDENTE_ID NUMBER(7,0), + REDONDEOCTRL_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + ORGAOCONCEDENTE_ID NUMBER(7,0), + CONSTRAINT PK__REDONDEO_ORGAO PRIMARY KEY (REDONDEOORGAOCONCEDENTE_ID), + FOREIGN KEY (REDONDEOCTRL_ID) REFERENCES REDONDEO_CTRL (REDONDEOCTRL_ID) ENABLE, + FOREIGN KEY (ORGAOCONCEDENTE_ID) REFERENCES ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID) ENABLE + )'; + exception + when dup_val_on_index then null; + when except_00955 then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20220913_0908__AL1226.sql b/src/db/migration/V20220913_0908__AL1226.sql new file mode 100644 index 000000000..7005359f5 --- /dev/null +++ b/src/db/migration/V20220913_0908__AL1226.sql @@ -0,0 +1,9 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO redondeo_orgaoconcedente (REDONDEOORGAOCONCEDENTE_ID, REDONDEOCTRL_ID, ACTIVO, FECMODIF, USUARIO_ID, ORGAOCONCEDENTE_ID) + select REDONDEO_ORGAOCONCEDENTE_SEQ.nextval, redondeoctrl_id, 1, sysdate, -1, 21 from redondeo_ctrl where activo = 1'; + exception when dup_val_on_index then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/V20220915_1100__jiraAL1379.sql b/src/db/migration/V20220915_1100__jiraAL1379.sql new file mode 100644 index 000000000..2bef80c02 --- /dev/null +++ b/src/db/migration/V20220915_1100__jiraAL1379.sql @@ -0,0 +1,23 @@ +declare + object_exists exception; + except_00957 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE CAJA RENAME COLUMN SEQUENCIAROD TO SEQUENCIARODTAXACURITIBA'; + exception + when object_exists then null; + when except_00957 then null; +end; +/ +declare + object_exists exception; + except_00957 exception; + pragma exception_init (object_exists , -01430); + pragma exception_init (except_00957 , -00957); +begin + execute immediate 'ALTER TABLE BOLETO RENAME COLUMN SEQUENCIAROD TO SEQUENCIARODTAXACURITIBA'; + exception + when object_exists then null; + when except_00957 then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20220916_1019__AL-1355.sql b/src/db/migration/V20220916_1019__AL-1355.sql new file mode 100644 index 000000000..8991518db --- /dev/null +++ b/src/db/migration/V20220916_1019__AL-1355.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_TARJETA ADD (SERIEFORMAPAGAMENTO VARCHAR(50))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_TARJETA ADD (SUBSERIEFORMAPAGAMENTO VARCHAR(50))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20221005_1432__AL1407.sql b/src/db/migration/V20221005_1432__AL1407.sql new file mode 100644 index 000000000..9c1099556 --- /dev/null +++ b/src/db/migration/V20221005_1432__AL1407.sql @@ -0,0 +1,8 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'INSERT INTO CONSTANTE (CONSTANTE_ID, NOMBCONSTANTE, DESCCONSTANTE, VALORCONSTANTE, INDTIPOCONSTANTE, INDMANTENIMIENTOUSUARIO, ACTIVO, FECMODIF, USUARIO_ID) + VALUES (CONSTANTE_SEQ.nextval, ''GENERACION_CORRIDA_APRIMORADA'', ''GENERACION_CORRIDA_APRIMORADA'', ''false'', ''1'', ''1'', ''1'', sysdate, ''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20221005_1649__al1331.sql b/src/db/migration/V20221005_1649__al1331.sql new file mode 100644 index 000000000..cdd7911f5 --- /dev/null +++ b/src/db/migration/V20221005_1649__al1331.sql @@ -0,0 +1,6 @@ +declare +begin + execute immediate 'UPDATE CONSTANTE SET VALORCONSTANTE = ''/transactions/void'' where constante_id = (select constante_id from constante where nombconstante like ''MP05_PATH_ESTORNO_MOBIPIX'') '; + exception when others then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/V20222709_1710__AL1328.sql b/src/db/migration/V20222709_1710__AL1328.sql new file mode 100644 index 000000000..5d8c5ab2b --- /dev/null +++ b/src/db/migration/V20222709_1710__AL1328.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -01430); +begin + execute immediate 'ALTER TABLE EVENTO_EXTRA ADD NUMERO_CONTROLE VARCHAR2(300)'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20220908_1630__jira1340.sql b/src/db/postgresql/migration/V20220908_1630__jira1340.sql new file mode 100644 index 000000000..6a3e5ec20 --- /dev/null +++ b/src/db/postgresql/migration/V20220908_1630__jira1340.sql @@ -0,0 +1,17 @@ +DO $$ +BEGIN + ALTER TABLE BOLETO ADD SEQUENCIARODTAXACURITIBA NUMERIC(10) ; + + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; + +/ + +DO $$ +BEGIN + ALTER TABLE CAJA ADD SEQUENCIARODTAXACURITIBA NUMERIC(10) ; + + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20220913_0907__AL1226.sql b/src/db/postgresql/migration/V20220913_0907__AL1226.sql new file mode 100644 index 000000000..d65846541 --- /dev/null +++ b/src/db/postgresql/migration/V20220913_0907__AL1226.sql @@ -0,0 +1,21 @@ +DO $$ +BEGIN + CREATE SEQUENCE "REDONDEO_ORGAOCONCEDENTE_SEQ" MINVALUE 1 MAXVALUE 999999999999999999 INCREMENT BY 1 START WITH 121 CACHE 20 NOORDER NOCYCLE NOKEEP NOSCALE GLOBAL; +END +$$; +/ +DO $$ +BEGIN + CREATE TABLE REDONDEO_ORGAOCONCEDENTE ( + REDONDEOORGAOCONCEDENTE_ID NUMBER(7,0), + REDONDEOCTRL_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + ORGAOCONCEDENTE_ID NUMBER(7,0), + CONSTRAINT PK__REDONDEO_ORGAO PRIMARY KEY (REDONDEOORGAOCONCEDENTE_ID), + FOREIGN KEY (REDONDEOCTRL_ID) REFERENCES REDONDEO_CTRL (REDONDEOCTRL_ID) ENABLE, + FOREIGN KEY (ORGAOCONCEDENTE_ID) REFERENCES ORGAO_CONCEDENTE (ORGAOCONCEDENTE_ID) ENABLE + ); +END +$$; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20220913_0908__AL1226.sql b/src/db/postgresql/migration/V20220913_0908__AL1226.sql new file mode 100644 index 000000000..4a7efb914 --- /dev/null +++ b/src/db/postgresql/migration/V20220913_0908__AL1226.sql @@ -0,0 +1,6 @@ +DO $$ +BEGIN + INSERT INTO redondeo_orgaoconcedente (REDONDEOORGAOCONCEDENTE_ID, REDONDEOCTRL_ID, ACTIVO, FECMODIF, USUARIO_ID, ORGAOCONCEDENTE_ID) + select REDONDEO_ORGAOCONCEDENTE_SEQ.nextval, redondeoctrl_id, 1, sysdate, -1, 21 from redondeo_ctrl where activo = 1; +END +$$; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20220916_1019__AL-1355.sql b/src/db/postgresql/migration/V20220916_1019__AL-1355.sql new file mode 100644 index 000000000..8991518db --- /dev/null +++ b/src/db/postgresql/migration/V20220916_1019__AL-1355.sql @@ -0,0 +1,15 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_TARJETA ADD (SERIEFORMAPAGAMENTO VARCHAR(50))'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CAJA_TARJETA ADD (SUBSERIEFORMAPAGAMENTO VARCHAR(50))'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20221005_1649__al1331.sql b/src/db/postgresql/migration/V20221005_1649__al1331.sql new file mode 100644 index 000000000..1f40618bc --- /dev/null +++ b/src/db/postgresql/migration/V20221005_1649__al1331.sql @@ -0,0 +1,5 @@ +DO $$ +BEGIN + UPDATE CONSTANTE SET VALORCONSTANTE = '/transactions/void' where constante_id = (select constante_id from constante where nombconstante like 'MP05_PATH_ESTORNO_MOBIPIX'); +END +$$; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20222709_1710__AL1328.sql b/src/db/postgresql/migration/V20222709_1710__AL1328.sql new file mode 100644 index 000000000..0b2d8a6b0 --- /dev/null +++ b/src/db/postgresql/migration/V20222709_1710__AL1328.sql @@ -0,0 +1,5 @@ +DO $$ +BEGIN + ALTER TABLE EVENTO_EXTRA ADD NUMERO_CONTROLE VARCHAR2(300); +END +$$; \ No newline at end of file