From 5204dd9512775b0a7b59632095a20abc290e1369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aristides=20dos=20Reis=20J=C3=BAnior?= Date: Thu, 4 Apr 2024 23:40:29 -0300 Subject: [PATCH] fixes bug#AL-3779 --- pom.xml | 2 +- src/db/migration/V20240326_1800__AL-3779.sql | 15 +++++++ src/db/migration/V20240401_1905__AL-3779.sql | 47 ++++++++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 src/db/migration/V20240326_1800__AL-3779.sql create mode 100644 src/db/migration/V20240401_1905__AL-3779.sql diff --git a/pom.xml b/pom.xml index ecf463b1e..c332a5fbf 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 br.com.rjconsultores Flyway - 1.35.0 + 1.36.0 diff --git a/src/db/migration/V20240326_1800__AL-3779.sql b/src/db/migration/V20240326_1800__AL-3779.sql new file mode 100644 index 000000000..373c41629 --- /dev/null +++ b/src/db/migration/V20240326_1800__AL-3779.sql @@ -0,0 +1,15 @@ +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 OCD_PARAM ADD (INDESTORNOPIX NUMBER(1))'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file diff --git a/src/db/migration/V20240401_1905__AL-3779.sql b/src/db/migration/V20240401_1905__AL-3779.sql new file mode 100644 index 000000000..064793c3f --- /dev/null +++ b/src/db/migration/V20240401_1905__AL-3779.sql @@ -0,0 +1,47 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate +'CREATE TABLE ESTORNO_OCD_PIX +( + ESTORNOOCDPIX_id NUMBER(8, 0) NOT NULL +, NOME VARCHAR2(150) +, TELEFONE VARCHAR2(15) +, CPF_CNPJ VARCHAR2(14) +, CHAVE_PIX VARCHAR2(100) +, TIPO_CHAVE_PIX VARCHAR2(40) +, ACTIVO NUMBER(1, 0) +, FECMODIF DATE +, OCD_ID NUMBER(7, 0) +, USUARIO_ID NUMBER(7, 0) +, PRIMARY KEY (ESTORNOOCDPIX_id) ENABLE +, CONSTRAINT ESTORNOOCDPIX_USUARIO_ID_FK FOREIGN KEY (USUARIO_ID) REFERENCES USUARIO(USUARIO_ID) ENABLE +, CONSTRAINT ESTORNOOCDPIX_OCD_ID_FK FOREIGN KEY (OCD_ID) REFERENCES OCD(OCD_ID) ENABLE +) '; + exception when object_exists then null; +end; +/ +declare + object_exists exception; + pragma exception_init (object_exists , -00955); +begin + execute immediate 'CREATE SEQUENCE "ESTORNO_OCD_PIX_CONFIG_SEQ" INCREMENT BY 1 START WITH 1 NOCACHE ORDER'; + exception when object_exists then null; +end; +/ +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 OCD ADD (VALOR_ESTORNO_PIX NUMBER(7, 2))'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end;