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