From 4240e2f8823b78440ac42f1b7c40df9430d90e17 Mon Sep 17 00:00:00 2001 From: Fabio Date: Tue, 16 Jul 2024 19:59:16 -0300 Subject: [PATCH] Cadastro de desconto por contrato feat bug#AL-4342 --- pom.xml | 2 +- src/db/migration/V20240716_1038__AL-4342.sql | 29 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 src/db/migration/V20240716_1038__AL-4342.sql diff --git a/pom.xml b/pom.xml index b00b75cd5..b6a76d13b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 br.com.rjconsultores Flyway - 1.66.0 + 1.67.0 diff --git a/src/db/migration/V20240716_1038__AL-4342.sql b/src/db/migration/V20240716_1038__AL-4342.sql new file mode 100644 index 000000000..0c4ce36d5 --- /dev/null +++ b/src/db/migration/V20240716_1038__AL-4342.sql @@ -0,0 +1,29 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE TABLE DESCONTO_CONTRATO ( + DESCONTOCONTRATO_ID NUMBER(7,0) PRIMARY KEY, + CONTRATO_ID NUMBER(7,0), + DATA_INICIAL DATE, + DATA_FINAL DATE, + PORCENTAGEM NUMBER(5,2), + INDDESCONTO NUMBER(1,0), + USUARIO_ID NUMBER(7,0), + ACTIVO NUMBER(1,0), + FECMODIF DATE, + CONSTRAINT fk_contrato_desconto FOREIGN KEY (CONTRATO_ID) REFERENCES CONTRATO_CORPORATIVO(CONTRATO_ID), + CONSTRAINT fk_usuario_contrato_desconto FOREIGN KEY (USUARIO_ID) REFERENCES USUARIO(USUARIO_ID) + )'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "DESCONTO_CONTRATO_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE'; + exception when object_exists then null; +end; +/