diff --git a/src/db/migration/V20200708_0954__mantis20082.sql b/src/db/migration/V20200708_0954__mantis20082.sql new file mode 100644 index 000000000..52e9510d2 --- /dev/null +++ b/src/db/migration/V20200708_0954__mantis20082.sql @@ -0,0 +1,35 @@ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE FORMA_PAGO ADD INDVOUCHERRODOVIARIA NUMBER(1,0)'; + exception when column_exists then null; +end; +/ +declare + column_exists exception; + pragma exception_init (column_exists , -01430); +begin + execute immediate 'ALTER TABLE SECRETARIA ADD FORMAPAGO_ID NUMBER(7,0)'; + exception when column_exists then null; +end; +/ +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 SECRETARIA ADD CONSTRAINT FORMAPAGO_ID_FK FOREIGN KEY(FORMAPAGO_ID)REFERENCES FORMA_PAGO(FORMAPAGO_ID)'; + exception + when object_exists then null; + when except_02275 then null; + when except_02270 then null; + when except_02261 then null; +end; + diff --git a/src/db/postgresql/migration/V20200708_0954__mantis20082.sql b/src/db/postgresql/migration/V20200708_0954__mantis20082.sql new file mode 100644 index 000000000..2764b6e45 --- /dev/null +++ b/src/db/postgresql/migration/V20200708_0954__mantis20082.sql @@ -0,0 +1,20 @@ +DO $$ +BEGIN + ALTER TABLE FORMA_PAGO ADD INDVOUCHERRODOVIARIA NUMBER(1,0) + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; +/ +DO $$ +BEGIN + ALTER TABLE SECRETARIA ADD FORMAPAGO_ID NUMBER(7,0) + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; +/ +DO $$ +BEGIN + ALTER TABLE SECRETARIA ADD CONSTRAINT FORMAPAGO_ID_FK FOREIGN KEY(FORMAPAGO_ID) REFERENCES FORMA_PAGO(FORMAPAGO_ID); + EXCEPTION WHEN duplicate_column THEN NULL; +END +$$; \ No newline at end of file