From 74f00a7ed1bed0a642aeb7c4d291226804bb6a91 Mon Sep 17 00:00:00 2001 From: "valdir.cordeiro" Date: Fri, 23 Aug 2024 10:03:27 -0300 Subject: [PATCH 1/3] =?UTF-8?q?Bolivariano=20-=20Adequa=C3=A7=C3=B5es=20Co?= =?UTF-8?q?nex=C3=A3o=20entre=20linhas=20feat=20bug#AL-4465?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- src/db/migration/V20240819_1116__AL-4465.sql | 29 ++++++++++++ src/db/migration/V20240820_1807__AL-4465.sql | 47 ++++++++++++++++++++ 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 src/db/migration/V20240819_1116__AL-4465.sql create mode 100644 src/db/migration/V20240820_1807__AL-4465.sql diff --git a/pom.xml b/pom.xml index d96b1cd05..d9aa2e6df 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 br.com.rjconsultores Flyway - 1.86.0 + 1.87.0 diff --git a/src/db/migration/V20240819_1116__AL-4465.sql b/src/db/migration/V20240819_1116__AL-4465.sql new file mode 100644 index 000000000..5bb9c6708 --- /dev/null +++ b/src/db/migration/V20240819_1116__AL-4465.sql @@ -0,0 +1,29 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE BLOQUEIO_CONEXAO ( + BLOQUEIOCONEXAO_ID NUMBER(15,0) NOT NULL, + RUTA_ID NUMBER(7,0), + CORRIDA_ID NUMBER(7,0), + FECCORRIDA DATE, + ISBLOQUEADO NUMBER(1,0), + CONEXIONRUTACONF_ID NUMBER(7,0), + ORIGEM_ID NUMBER(7,0), + DESTINO_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + USUARIO_ID NUMBER(7,0), + CONSTRAINT BLOQUEIO_CONEXAO_PK PRIMARY KEY (BLOQUEIOCONEXAO_ID) + )'; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE BLOQUEIO_CONEXAO_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE'; + exception when object_exists then null; +end; +/ \ No newline at end of file diff --git a/src/db/migration/V20240820_1807__AL-4465.sql b/src/db/migration/V20240820_1807__AL-4465.sql new file mode 100644 index 000000000..047ec86fe --- /dev/null +++ b/src/db/migration/V20240820_1807__AL-4465.sql @@ -0,0 +1,47 @@ +-- ALTER TABLE ADD COLUMN +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CONF ADD (ISBLOQUEIOTRECHO_A NUMBER(1,0), ISBLOQUEIOTRECHO_B NUMBER(1,0), ISBLOQUEIOTRECHO_C NUMBER(1,0))'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +-- ALTER TABLE ADD COLUMN +declare + object_exists exception; + except_01451 exception; + except_01442 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_01451 , -01451); + pragma exception_init (except_01442 , -01442); +begin + execute immediate 'ALTER TABLE CONEXION_RUTA_CONF ADD (PORCENTAGEM_OCUPACAO NUMBER(7,0), MINUTOS_ANTES_PARTIDA NUMBER(7,0) ) '; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; +/ +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 CUSTOM (CUSTOM_ID, SISTEMA, CHAVE, VALOR, TIPO, ACTIVO, ORDEM, FECMODIF, USUARIO_ID) + VALUES (CUSTOM_SEQ.nextval, 1, ''usaBloqueioTrechoConexao'', 0, 1, 1, 0, sysdate, 1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file From 6b1f0b5f2363ed445a3c87eba79b91cad7ecadba Mon Sep 17 00:00:00 2001 From: "valdir.cordeiro" Date: Fri, 23 Aug 2024 10:14:31 -0300 Subject: [PATCH 2/3] =?UTF-8?q?Bolivariano=20-=20Adequa=C3=A7=C3=B5es=20Co?= =?UTF-8?q?nex=C3=A3o=20entre=20linhas=20feat=20bug#AL-4465?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/db/migration/V20240820_1807__AL-4465.sql | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/db/migration/V20240820_1807__AL-4465.sql b/src/db/migration/V20240820_1807__AL-4465.sql index 047ec86fe..d646fb51c 100644 --- a/src/db/migration/V20240820_1807__AL-4465.sql +++ b/src/db/migration/V20240820_1807__AL-4465.sql @@ -8,24 +8,7 @@ declare pragma exception_init (except_01451 , -01451); pragma exception_init (except_01442 , -01442); begin - execute immediate 'ALTER TABLE CONEXION_RUTA_CONF ADD (ISBLOQUEIOTRECHO_A NUMBER(1,0), ISBLOQUEIOTRECHO_B NUMBER(1,0), ISBLOQUEIOTRECHO_C NUMBER(1,0))'; - exception - when object_exists then null; - when except_01451 then null; - when except_01442 then null; -end; -/ --- ALTER TABLE ADD COLUMN -declare - object_exists exception; - except_01451 exception; - except_01442 exception; - - pragma exception_init (object_exists , -01430); - pragma exception_init (except_01451 , -01451); - pragma exception_init (except_01442 , -01442); -begin - execute immediate 'ALTER TABLE CONEXION_RUTA_CONF ADD (PORCENTAGEM_OCUPACAO NUMBER(7,0), MINUTOS_ANTES_PARTIDA NUMBER(7,0) ) '; + execute immediate 'ALTER TABLE CONEXION_RUTA_CONF ADD (ISBLOQUEIOTRECHO_A NUMBER(1,0), ISBLOQUEIOTRECHO_B NUMBER(1,0), ISBLOQUEIOTRECHO_C NUMBER(1,0), PORCENTAGEM_OCUPACAO NUMBER(7,0), MINUTOS_ANTES_PARTIDA NUMBER(7,0))'; exception when object_exists then null; when except_01451 then null; From 44d0ebc4f3e342014c0d6fe7b014cbf01f33e4ce Mon Sep 17 00:00:00 2001 From: "valdir.cordeiro" Date: Fri, 23 Aug 2024 10:29:21 -0300 Subject: [PATCH 3/3] =?UTF-8?q?Bolivariano=20-=20Adequa=C3=A7=C3=B5es=20Co?= =?UTF-8?q?nex=C3=A3o=20entre=20linhas=20feat=20bug#AL-4465?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/db/migration/V20240820_1807__AL-4465.sql | 14 -------------- src/db/migration/V20240823_1028__AL-4465.sql | 13 +++++++++++++ 2 files changed, 13 insertions(+), 14 deletions(-) create mode 100644 src/db/migration/V20240823_1028__AL-4465.sql diff --git a/src/db/migration/V20240820_1807__AL-4465.sql b/src/db/migration/V20240820_1807__AL-4465.sql index d646fb51c..bc9eb2863 100644 --- a/src/db/migration/V20240820_1807__AL-4465.sql +++ b/src/db/migration/V20240820_1807__AL-4465.sql @@ -14,17 +14,3 @@ begin when except_01451 then null; when except_01442 then null; end; -/ -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 CUSTOM (CUSTOM_ID, SISTEMA, CHAVE, VALOR, TIPO, ACTIVO, ORDEM, FECMODIF, USUARIO_ID) - VALUES (CUSTOM_SEQ.nextval, 1, ''usaBloqueioTrechoConexao'', 0, 1, 1, 0, sysdate, 1)'; - exception - when dup_val_on_index then null; - when except_02291 then null; -end; \ No newline at end of file diff --git a/src/db/migration/V20240823_1028__AL-4465.sql b/src/db/migration/V20240823_1028__AL-4465.sql new file mode 100644 index 000000000..007a54efe --- /dev/null +++ b/src/db/migration/V20240823_1028__AL-4465.sql @@ -0,0 +1,13 @@ +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 CUSTOM (CUSTOM_ID, SISTEMA, CHAVE, VALOR, TIPO, ACTIVO, ORDEM, FECMODIF, USUARIO_ID) + VALUES (CUSTOM_SEQ.nextval, 1, ''usaBloqueioTrechoConexao'', 0, 1, 1, 0, sysdate, 1)'; + exception + when dup_val_on_index then null; + when except_02291 then null; +end; \ No newline at end of file