From 788384b673f34a9bd0326f8aa6ce482b94355963 Mon Sep 17 00:00:00 2001 From: fabio Date: Thu, 24 Oct 2019 18:17:24 +0000 Subject: [PATCH] =?UTF-8?q?fixes=20bug#16623=20dev:=20Lucas=20Silv=C3=A9ri?= =?UTF-8?q?o=20qua:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@98447 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../migration/V20191023_1704__mantis16623.sql | 10 ++++++++++ .../migration/V20191023_1705__mantis16623.sql | 17 +++++++++++++++++ .../migration/V20191023_1706__mantis16623.sql | 18 ++++++++++++++++++ .../migration/V20191023_1707__mantis16623.sql | 7 +++++++ .../migration/V20191024_1018__mantis16623.sql | 7 +++++++ 5 files changed, 59 insertions(+) create mode 100644 src/db/migration/V20191023_1704__mantis16623.sql create mode 100644 src/db/migration/V20191023_1705__mantis16623.sql create mode 100644 src/db/migration/V20191023_1706__mantis16623.sql create mode 100644 src/db/migration/V20191023_1707__mantis16623.sql create mode 100644 src/db/migration/V20191024_1018__mantis16623.sql diff --git a/src/db/migration/V20191023_1704__mantis16623.sql b/src/db/migration/V20191023_1704__mantis16623.sql new file mode 100644 index 000000000..35aab4a5f --- /dev/null +++ b/src/db/migration/V20191023_1704__mantis16623.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_CORRIDA_TOTVS'',''CRON_ROTINA_INTEGRACAO_CORRIDA_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/V20191023_1705__mantis16623.sql b/src/db/migration/V20191023_1705__mantis16623.sql new file mode 100644 index 000000000..c4a4edb88 --- /dev/null +++ b/src/db/migration/V20191023_1705__mantis16623.sql @@ -0,0 +1,17 @@ +declare + table_exists exception; + pragma exception_init (table_exists , -00955); +begin + execute immediate + 'CREATE TABLE INTEGRACAO_TOTVS_CORRIDA ( + INTEGRACAOCORRIDA_ID NUMBER(15) NOT NULL + , CORRIDA_ID NUMBER(7) NOT NULL + , FECCORRIDA DATE NOT NULL + , INTEGRADOTOTVS NUMBER(5) + , FECHOREFETIVA TIMESTAMP + , MSG_RETORNO CLOB + , CONSTRAINT INTEGRACAO_TOTVS_CORRIDA_PK PRIMARY KEY ( INTEGRACAOCORRIDA_ID ) + )'; + + exception when table_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20191023_1706__mantis16623.sql b/src/db/migration/V20191023_1706__mantis16623.sql new file mode 100644 index 000000000..a6ce00283 --- /dev/null +++ b/src/db/migration/V20191023_1706__mantis16623.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_CORRIDA ADD CONSTRAINT INTEGRACAO_TOTVS_CORRIDA_FK1 FOREIGN KEY(CORRIDA_ID, FECCORRIDA )REFERENCES CORRIDA(CORRIDA_ID, FECCORRIDA )'; + 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/V20191023_1707__mantis16623.sql b/src/db/migration/V20191023_1707__mantis16623.sql new file mode 100644 index 000000000..c94705367 --- /dev/null +++ b/src/db/migration/V20191023_1707__mantis16623.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE INTEGRACAO_TOTVS_CORRIDA_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/V20191024_1018__mantis16623.sql b/src/db/migration/V20191024_1018__mantis16623.sql new file mode 100644 index 000000000..eee96b203 --- /dev/null +++ b/src/db/migration/V20191024_1018__mantis16623.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE CORRIDA ADD (FECHORINTEGRADOTOTVS DATE, CONTADORINTEGRADOTOTVS NUMBER(7,0) )'; + exception when column_exists then null; +end; \ No newline at end of file