fixes bug#15084

dev: Lucas Silvério
qua:

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@96153 d1611594-4594-4d17-8e1d-87c2c4800839
master
fabio 2019-07-26 20:26:19 +00:00
parent 33396e2d4b
commit 762fac488a
12 changed files with 114 additions and 0 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;