From 460b21991c4bbbd6573b86b48d7664c4d7908623 Mon Sep 17 00:00:00 2001 From: lucassilverio Date: Wed, 31 Jul 2019 20:30:19 +0000 Subject: [PATCH] fixes bug#14849 dev: Jhonatas qua: XXX git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@96291 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../migration/V20190729_1652__mantis14849.sql | 16 ++++++++++++++++ .../migration/V20190729_1653__mantis14849.sql | 7 +++++++ .../migration/V20190729_1654__mantis14849.sql | 18 ++++++++++++++++++ .../migration/V20190729_1655__mantis14849.sql | 10 ++++++++++ .../migration/V20190729_1656__mantis14849.sql | 7 +++++++ .../migration/V20190729_1657__mantis14849.sql | 10 ++++++++++ .../migration/V20190729_1652__mantis14849.sql | 16 ++++++++++++++++ .../migration/V20190729_1653__mantis14849.sql | 7 +++++++ .../migration/V20190729_1654__mantis14849.sql | 7 +++++++ .../migration/V20190729_1655__mantis14849.sql | 10 ++++++++++ .../migration/V20190729_1656__mantis14849.sql | 7 +++++++ .../migration/V20190729_1657__mantis14849.sql | 10 ++++++++++ 12 files changed, 125 insertions(+) create mode 100644 src/db/migration/V20190729_1652__mantis14849.sql create mode 100644 src/db/migration/V20190729_1653__mantis14849.sql create mode 100644 src/db/migration/V20190729_1654__mantis14849.sql create mode 100644 src/db/migration/V20190729_1655__mantis14849.sql create mode 100644 src/db/migration/V20190729_1656__mantis14849.sql create mode 100644 src/db/migration/V20190729_1657__mantis14849.sql create mode 100644 src/db/postgresql/migration/V20190729_1652__mantis14849.sql create mode 100644 src/db/postgresql/migration/V20190729_1653__mantis14849.sql create mode 100644 src/db/postgresql/migration/V20190729_1654__mantis14849.sql create mode 100644 src/db/postgresql/migration/V20190729_1655__mantis14849.sql create mode 100644 src/db/postgresql/migration/V20190729_1656__mantis14849.sql create mode 100644 src/db/postgresql/migration/V20190729_1657__mantis14849.sql diff --git a/src/db/migration/V20190729_1652__mantis14849.sql b/src/db/migration/V20190729_1652__mantis14849.sql new file mode 100644 index 000000000..ec729de09 --- /dev/null +++ b/src/db/migration/V20190729_1652__mantis14849.sql @@ -0,0 +1,16 @@ +declare + table_exists exception; + pragma exception_init (table_exists , -00955); +begin + execute immediate + 'CREATE TABLE INTEGRACAO_TOTVS_REDUCAO ( + INTEGRACAOREDUCAO_ID NUMBER(15) NOT NULL + , FISCALR2_ID NUMBER(15) NOT NULL + , INTEGRADOTOTVS NUMBER(5) + , FECHOREFETIVA TIMESTAMP + , MSG_RETORNO CLOB + , CONSTRAINT INTEGRACAO_TOTVS_REDUCAO_PK PRIMARY KEY ( INTEGRACAOREDUCAO_ID ) + )'; + + exception when table_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20190729_1653__mantis14849.sql b/src/db/migration/V20190729_1653__mantis14849.sql new file mode 100644 index 000000000..ce7a381f4 --- /dev/null +++ b/src/db/migration/V20190729_1653__mantis14849.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE INTEGRACAO_TOTVS_REDUCAO_SEQ INCREMENT BY 1 START WITH 1'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20190729_1654__mantis14849.sql b/src/db/migration/V20190729_1654__mantis14849.sql new file mode 100644 index 000000000..047acff4f --- /dev/null +++ b/src/db/migration/V20190729_1654__mantis14849.sql @@ -0,0 +1,18 @@ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + except_02261 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); + pragma exception_init (except_02261 , -02261); +begin + execute immediate 'ALTER TABLE INTEGRACAO_TOTVS_REDUCAO ADD CONSTRAINT INTEGRACAO_TOTVS_REDUCAO_FK1 FOREIGN KEY(FISCALR2_ID )REFERENCES FISCAL_R2(FISCALR2_ID )'; + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; diff --git a/src/db/migration/V20190729_1655__mantis14849.sql b/src/db/migration/V20190729_1655__mantis14849.sql new file mode 100644 index 000000000..f54e3ec5f --- /dev/null +++ b/src/db/migration/V20190729_1655__mantis14849.sql @@ -0,0 +1,10 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''CRON_ROTINA_REINTEGRACAO_REDUCAO_TOTVS'',''CRON_ROTINA_REINTEGRACAO_REDUCAO_TOTVS'', + 1,null,null,''1'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20190729_1656__mantis14849.sql b/src/db/migration/V20190729_1656__mantis14849.sql new file mode 100644 index 000000000..9c0ee509b --- /dev/null +++ b/src/db/migration/V20190729_1656__mantis14849.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_R2 ADD (FECHORINTEGRADOTOTVS DATE, CONTADORINTEGRADOTOTVS NUMBER(7,0) )'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20190729_1657__mantis14849.sql b/src/db/migration/V20190729_1657__mantis14849.sql new file mode 100644 index 000000000..c73623c5e --- /dev/null +++ b/src/db/migration/V20190729_1657__mantis14849.sql @@ -0,0 +1,10 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''CRON_ROTINA_INTEGRACAO_REDUCAO_TOTVS'',''CRON_ROTINA_INTEGRACAO_REDUCAO_TOTVS'', + 1,null,null,''1'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20190729_1652__mantis14849.sql b/src/db/postgresql/migration/V20190729_1652__mantis14849.sql new file mode 100644 index 000000000..7c21496ae --- /dev/null +++ b/src/db/postgresql/migration/V20190729_1652__mantis14849.sql @@ -0,0 +1,16 @@ +declare + table_exists exception; + pragma exception_init (table_exists , -00955); +begin + execute immediate + 'CREATE TABLE INTEGRACAO_TOTVS_REDUCAO ( + INTEGRACAOREDUCAO_ID NUMBER(15) NOT NULL + , ESQUEMACORRIDA_ID NUMBER(15) NOT NULL + , INTEGRADOTOTVS NUMBER(5) + , FECHOREFETIVA TIMESTAMP + , MSG_RETORNO CLOB + , CONSTRAINT INTEGRACAO_TOTVS_REDUCAO_PK PRIMARY KEY ( INTEGRACAOREDUCAO_ID ) + )'; + + exception when table_exists then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20190729_1653__mantis14849.sql b/src/db/postgresql/migration/V20190729_1653__mantis14849.sql new file mode 100644 index 000000000..ce7a381f4 --- /dev/null +++ b/src/db/postgresql/migration/V20190729_1653__mantis14849.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE INTEGRACAO_TOTVS_REDUCAO_SEQ INCREMENT BY 1 START WITH 1'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20190729_1654__mantis14849.sql b/src/db/postgresql/migration/V20190729_1654__mantis14849.sql new file mode 100644 index 000000000..18101b251 --- /dev/null +++ b/src/db/postgresql/migration/V20190729_1654__mantis14849.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'ALTER TABLE INTEGRACAO_TOTVS_REDUCAO ADD CONSTRAINT INTEGRACAO_TOTVS_REDUCAO_FK1 FOREIGN KEY(ESQUEMACORRIDA_ID )REFERENCES ESQUEMA_CORRIDA(ESQUEMACORRIDA_ID )'; + exception when object_exists then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20190729_1655__mantis14849.sql b/src/db/postgresql/migration/V20190729_1655__mantis14849.sql new file mode 100644 index 000000000..909735467 --- /dev/null +++ b/src/db/postgresql/migration/V20190729_1655__mantis14849.sql @@ -0,0 +1,10 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''CRON_ROTINA_REINTEGRACAO_REDUCAO_TOTVS'',''CRON_ROTINA_REINTEGRACAO_REDUCAO_TOTVS'', + 1,null,null,''0'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20190729_1656__mantis14849.sql b/src/db/postgresql/migration/V20190729_1656__mantis14849.sql new file mode 100644 index 000000000..9c0ee509b --- /dev/null +++ b/src/db/postgresql/migration/V20190729_1656__mantis14849.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FISCAL_R2 ADD (FECHORINTEGRADOTOTVS DATE, CONTADORINTEGRADOTOTVS NUMBER(7,0) )'; + exception when column_exists then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20190729_1657__mantis14849.sql b/src/db/postgresql/migration/V20190729_1657__mantis14849.sql new file mode 100644 index 000000000..c73623c5e --- /dev/null +++ b/src/db/postgresql/migration/V20190729_1657__mantis14849.sql @@ -0,0 +1,10 @@ +declare + dup_val_on_index exception; + pragma exception_init (dup_val_on_index , -00001); +begin + execute immediate 'Insert into CONSTANTE (CONSTANTE_ID,NOMBCONSTANTE,DESCCONSTANTE,INDTIPOCONSTANTE, + VALORCONSTANTE,INDMANTENIMIENTOUSUARIO,ACTIVO,FECMODIF,USUARIO_ID) + values (CONSTANTE_SEQ.NEXTVAL,''CRON_ROTINA_INTEGRACAO_REDUCAO_TOTVS'',''CRON_ROTINA_INTEGRACAO_REDUCAO_TOTVS'', + 1,null,null,''1'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file