diff --git a/pom.xml b/pom.xml index 610292fe3..dd9368cd3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 br.com.rjconsultores Flyway - 1.92.1 + 1.92.2 diff --git a/src/db/migration/V20240909_1744__AL-4833.sql b/src/db/migration/V20240909_1744__AL-4833.sql new file mode 100644 index 000000000..0593b9e79 --- /dev/null +++ b/src/db/migration/V20240909_1744__AL-4833.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 CONTRATO_CORPORATIVO ADD EMPRESA_ID NUMBER(7,0)'; + 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/V20240909_1814__AL-4833.sql b/src/db/migration/V20240909_1814__AL-4833.sql new file mode 100644 index 000000000..c0bb5d7c9 --- /dev/null +++ b/src/db/migration/V20240909_1814__AL-4833.sql @@ -0,0 +1,18 @@ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + except_02261 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); + pragma exception_init (except_02261 , -02261); +begin + execute immediate 'ALTER TABLE contrato_corporativo ADD CONSTRAINT fk_empresa_contrato_corp FOREIGN KEY (empresa_id) REFERENCES empresa(empresa_id)'; + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; \ No newline at end of file diff --git a/src/db/template/alter_table.sql b/src/db/template/alter_table.sql new file mode 100644 index 000000000..6e4a17a0f --- /dev/null +++ b/src/db/template/alter_table.sql @@ -0,0 +1,18 @@ +declare + object_exists exception; + except_02275 exception; + except_02270 exception; + except_02261 exception; + + pragma exception_init (object_exists , -01430); + pragma exception_init (except_02275 , -02275); + pragma exception_init (except_02270 , -02270); + pragma exception_init (except_02261 , -02261); +begin + execute immediate '...'; + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; \ No newline at end of file diff --git a/src/db/template/modify_column.sql b/src/db/template/modify_column.sql new file mode 100644 index 000000000..a4e390c7c --- /dev/null +++ b/src/db/template/modify_column.sql @@ -0,0 +1,16 @@ +-- 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 '...'; + exception + when object_exists then null; + when except_01451 then null; + when except_01442 then null; +end; \ No newline at end of file