diff --git a/src/db/migration/V20190723_1135__mantis15084.sql b/src/db/migration/V20190723_1135__mantis15084.sql new file mode 100644 index 000000000..7176b2e41 --- /dev/null +++ b/src/db/migration/V20190723_1135__mantis15084.sql @@ -0,0 +1,16 @@ +declare + table_exists exception; + pragma exception_init (table_exists , -00955); +begin + execute immediate + 'CREATE TABLE INTEGRACAO_TOTVS_SERVICO ( + INTEGRACAOSERVICO_ID NUMBER(15) NOT NULL + , ESQUEMACORRIDA_ID NUMBER(7) NOT NULL + , INTEGRADOTOTVS NUMBER(5) + , FECHOREFETIVA TIMESTAMP + , MSG_RETORNO CLOB + , CONSTRAINT INTEGRACAO_TOTVS_SERVICO_PK PRIMARY KEY ( INTEGRACAOSERVICO_ID ) + )'; + + exception when table_exists then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20190723_1136__mantis15084.sql b/src/db/migration/V20190723_1136__mantis15084.sql new file mode 100644 index 000000000..5373921a1 --- /dev/null +++ b/src/db/migration/V20190723_1136__mantis15084.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE INTEGRACAO_TOTVS_SERVICO_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/V20190723_1137__mantis15084.sql b/src/db/migration/V20190723_1137__mantis15084.sql new file mode 100644 index 000000000..dbe44e088 --- /dev/null +++ b/src/db/migration/V20190723_1137__mantis15084.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'ALTER TABLE INTEGRACAO_TOTVS_SERVICO ADD CONSTRAINT INTEGRACAO_TOTVS_SERVICO_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/migration/V20190723_1138__mantis15084.sql b/src/db/migration/V20190723_1138__mantis15084.sql new file mode 100644 index 000000000..283ed8571 --- /dev/null +++ b/src/db/migration/V20190723_1138__mantis15084.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_SERVICO_TOTVS'',''CRON_ROTINA_REINTEGRACAO_SERVICO_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/V20190723_1646__mantis15084.sql b/src/db/migration/V20190723_1646__mantis15084.sql new file mode 100644 index 000000000..983ed45ae --- /dev/null +++ b/src/db/migration/V20190723_1646__mantis15084.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA 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/V20190726_1621__mantis15085.sql b/src/db/migration/V20190726_1621__mantis15085.sql new file mode 100644 index 000000000..7b49b0398 --- /dev/null +++ b/src/db/migration/V20190726_1621__mantis15085.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_SERVICO_TOTVS'',''CRON_ROTINA_INTEGRACAO_SERVICO_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/V20190723_1135__mantis15084.sql b/src/db/postgresql/migration/V20190723_1135__mantis15084.sql new file mode 100644 index 000000000..7176b2e41 --- /dev/null +++ b/src/db/postgresql/migration/V20190723_1135__mantis15084.sql @@ -0,0 +1,16 @@ +declare + table_exists exception; + pragma exception_init (table_exists , -00955); +begin + execute immediate + 'CREATE TABLE INTEGRACAO_TOTVS_SERVICO ( + INTEGRACAOSERVICO_ID NUMBER(15) NOT NULL + , ESQUEMACORRIDA_ID NUMBER(7) NOT NULL + , INTEGRADOTOTVS NUMBER(5) + , FECHOREFETIVA TIMESTAMP + , MSG_RETORNO CLOB + , CONSTRAINT INTEGRACAO_TOTVS_SERVICO_PK PRIMARY KEY ( INTEGRACAOSERVICO_ID ) + )'; + + exception when table_exists then null; +end; \ No newline at end of file diff --git a/src/db/postgresql/migration/V20190723_1136__mantis15084.sql b/src/db/postgresql/migration/V20190723_1136__mantis15084.sql new file mode 100644 index 000000000..5373921a1 --- /dev/null +++ b/src/db/postgresql/migration/V20190723_1136__mantis15084.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE INTEGRACAO_TOTVS_SERVICO_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/V20190723_1137__mantis15084.sql b/src/db/postgresql/migration/V20190723_1137__mantis15084.sql new file mode 100644 index 000000000..dbe44e088 --- /dev/null +++ b/src/db/postgresql/migration/V20190723_1137__mantis15084.sql @@ -0,0 +1,7 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'ALTER TABLE INTEGRACAO_TOTVS_SERVICO ADD CONSTRAINT INTEGRACAO_TOTVS_SERVICO_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/V20190723_1138__mantis15084.sql b/src/db/postgresql/migration/V20190723_1138__mantis15084.sql new file mode 100644 index 000000000..9aac8fa8d --- /dev/null +++ b/src/db/postgresql/migration/V20190723_1138__mantis15084.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_SERVICO_TOTVS'',''CRON_ROTINA_REINTEGRACAO_SERVICO_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/V20190723_1646__mantis15084.sql b/src/db/postgresql/migration/V20190723_1646__mantis15084.sql new file mode 100644 index 000000000..983ed45ae --- /dev/null +++ b/src/db/postgresql/migration/V20190723_1646__mantis15084.sql @@ -0,0 +1,7 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE ESQUEMA_CORRIDA 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/V20190726_1621__mantis15085.sql b/src/db/postgresql/migration/V20190726_1621__mantis15085.sql new file mode 100644 index 000000000..7b49b0398 --- /dev/null +++ b/src/db/postgresql/migration/V20190726_1621__mantis15085.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_SERVICO_TOTVS'',''CRON_ROTINA_INTEGRACAO_SERVICO_TOTVS'', + 1,null,null,''1'',sysdate,''1'')'; + exception when dup_val_on_index then null; +end; \ No newline at end of file