Merge pull request 'AL-1786' (#5) from AL-1786 into master

Reviewed-on: http://18.235.188.113:3000/utilidades/Flyway/pulls/5
Reviewed-by: Gleison da Cruz <gleison.cruz@totvs.com.br>
Reviewed-by: Valdir Cordeiro <valdir.cordeiro@totvs.com.br>
master
fabio 2022-12-23 14:01:03 +00:00
commit 327bcc0dd8
8 changed files with 171 additions and 1 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.rjconsultores</groupId>
<artifactId>Flyway</artifactId>
<version>1.0.6</version>
<version>1.0.7</version>
<distributionManagement>
<repository>

View File

@ -0,0 +1,30 @@
declare
object_exists exception;
pragma exception_init (object_exists , -00955);
begin
execute immediate
'CREATE TABLE EMPRESA_CIELOLINK_CONFIG
(
EMPRESACIELOLINK_ID NUMBER(7, 0) NOT NULL
, EMPRESA_ID NUMBER(7, 0)
, CLIENT_ID VARCHAR2(50 BYTE)
, MERCHANT_ID VARCHAR2(50 BYTE)
, SECRET VARCHAR2(50 BYTE)
, MINUTOS_CANCELA NUMBER(7,0)
, URL VARCHAR2(50 BYTE)
, ACTIVO NUMBER(1,0)
, FECMODIF DATE
, USUARIO_ID NUMBER(7,0)
, CONSTRAINT EMPRESA_CIELOLINK_CONFIG PRIMARY KEY ( EMPRESACIELOLINK_ID ) ENABLE ) ';
exception when object_exists then null;
end;
/
declare
object_exists exception;
pragma exception_init (object_exists , -00955);
begin
execute immediate
'CREATE SEQUENCE EMP_CIELOLINK_CONFIG_SEQ';
exception when object_exists then null;
end;

View File

@ -0,0 +1,13 @@
-- INSERT / UPDATE
declare
dup_val_on_index exception;
except_02291 exception;
pragma exception_init (dup_val_on_index , -00001);
pragma exception_init (except_02291 , -02291);
begin
execute immediate 'Insert into AUTORIZACION (AUTORIZACION_ID,NOMBAUTORIZACION,DESCAUTORIZACION,ACTIVO,FECMODIF,USUARIO_ID) values (AUTORIZACION_SEQ.NEXTVAL,''AUT_MAPA_LGPD'',''AUTORIZACAO PARA EXIBIR DADOS LGPD NO MAPA DE VIAGEM'',1,SYSDATE,1)';
exception
when dup_val_on_index then null;
when except_02291 then null;
end;

View File

@ -0,0 +1,28 @@
-- INSERT / UPDATE
declare
dup_val_on_index exception;
except_02291 exception;
pragma exception_init (dup_val_on_index , -00001);
pragma exception_init (except_02291 , -02291);
begin
execute immediate 'Insert into empresa_cielolink_config
(empresacielolink_id, empresa_id, merchant_id, minutos_cancela, client_id, url, secret, usuario_id, fecmodif, activo)
select
EMP_CIELOLINK_CONFIG_SEQ.nextval, empresa_id, merchant_id , minutos , client_id , url , secret , usuario_id , fecmodif, activo from
(
select
empresa_id,
(SELECT valorconstante FROM constante where nombconstante like ''MERCHANT_ID_CIELO_LINK'') as merchant_id,
(SELECT valorconstante FROM constante where nombconstante like ''MINUTOS_EXPIRACAO_CIELO_LINK'') as minutos,
(SELECT valorconstante FROM constante where nombconstante like ''CLIENT_ID_CIELO_LINK'') as client_id,
(SELECT valorconstante FROM constante where nombconstante like ''URL_CIELO_LINK'') as url,
(SELECT valorconstante FROM constante where nombconstante like ''SECRET_CIELO_LINK'') as secret,
1 as usuario_id,
sysdate as fecmodif,
1 as activo
from empresa where activo = 1 order by empresa_id) dados';
exception
when dup_val_on_index then null;
when except_02291 then null;
end;

View File

@ -0,0 +1,28 @@
declare
object_exists exception;
pragma exception_init (object_exists , -00955);
begin
execute immediate
'CREATE TABLE EMPRESA_EREDE_CONFIG
(
EMPRESAEREDE_ID NUMBER(7, 0) NOT NULL
, EMPRESA_ID NUMBER(7, 0)
, FILIATION VARCHAR2(50 BYTE)
, TOKEN VARCHAR2(100 BYTE)
, INDPRODUCAO NUMBER(1,0)
, ACTIVO NUMBER(1,0)
, FECMODIF DATE
, USUARIO_ID NUMBER(7,0)
, CONSTRAINT EMPRESA_EREDE_CONFIG PRIMARY KEY ( EMPRESAEREDE_ID ) ENABLE ) ';
exception when object_exists then null;
end;
/
declare
object_exists exception;
pragma exception_init (object_exists , -00955);
begin
execute immediate
'CREATE SEQUENCE EMP_EREDE_CONFIG_SEQ';
exception when object_exists then null;
end;

View File

@ -0,0 +1,30 @@
declare
object_exists exception;
pragma exception_init (object_exists , -00955);
begin
execute immediate
'CREATE TABLE EMPRESA_CIELOLINK_CONFIG
(
EMPRESACIELOLINK_ID NUMBER(7, 0) NOT NULL
, EMPRESA_ID NUMBER(7, 0)
, CLIENT_ID VARCHAR2(50 BYTE)
, MERCHANT_ID VARCHAR2(50 BYTE)
, SECRET VARCHAR2(50 BYTE)
, MINUTOS_CANCELA NUMBER(7,0)
, URL VARCHAR2(50 BYTE)
, ACTIVO NUMBER(1,0)
, FECMODIF DATE
, USUARIO_ID NUMBER(7,0)
, CONSTRAINT EMPRESA_CIELOLINK_CONFIG PRIMARY KEY ( EMPRESACIELOLINK_ID ) ENABLE ) ';
exception when object_exists then null;
end;
/
declare
object_exists exception;
pragma exception_init (object_exists , -00955);
begin
execute immediate
'CREATE SEQUENCE EMP_CIELOLINK_CONFIG_SEQ';
exception when object_exists then null;
end;

View File

@ -0,0 +1,13 @@
-- INSERT / UPDATE
declare
dup_val_on_index exception;
except_02291 exception;
pragma exception_init (dup_val_on_index , -00001);
pragma exception_init (except_02291 , -02291);
begin
execute immediate 'Insert into AUTORIZACION (AUTORIZACION_ID,NOMBAUTORIZACION,DESCAUTORIZACION,ACTIVO,FECMODIF,USUARIO_ID) values (AUTORIZACION_SEQ.NEXTVAL,''AUT_MAPA_LGPD'',''AUTORIZACAO PARA EXIBIR DADOS LGPD NO MAPA DE VIAGEM'',1,SYSDATE,1)';
exception
when dup_val_on_index then null;
when except_02291 then null;
end;

View File

@ -0,0 +1,28 @@
-- INSERT / UPDATE
declare
dup_val_on_index exception;
except_02291 exception;
pragma exception_init (dup_val_on_index , -00001);
pragma exception_init (except_02291 , -02291);
begin
execute immediate 'Insert into empresa_cielolink_config
(empresacielolink_id, empresa_id, merchant_id, minutos_cancela, client_id, url, secret, usuario_id, fecmodif, activo)
select
EMP_CIELOLINK_CONFIG_SEQ.nextval, empresa_id, merchant_id , minutos , client_id , url , secret , usuario_id , fecmodif, activo from
(
select
empresa_id,
(SELECT valorconstante FROM constante where nombconstante like ''MERCHANT_ID_CIELO_LINK'') as merchant_id,
(SELECT valorconstante FROM constante where nombconstante like ''MINUTOS_EXPIRACAO_CIELO_LINK'') as minutos,
(SELECT valorconstante FROM constante where nombconstante like ''CLIENT_ID_CIELO_LINK'') as client_id,
(SELECT valorconstante FROM constante where nombconstante like ''URL_CIELO_LINK'') as url,
(SELECT valorconstante FROM constante where nombconstante like ''SECRET_CIELO_LINK'') as secret,
1 as usuario_id,
sysdate as fecmodif,
1 as activo
from empresa where activo = 1 order by empresa_id) dados';
exception
when dup_val_on_index then null;
when except_02291 then null;
end;