diff --git a/src/db/migration/V20170523_1500__mantis8900.sql b/src/db/migration/V20170523_1500__mantis8900.sql new file mode 100644 index 000000000..a3caa7d17 --- /dev/null +++ b/src/db/migration/V20170523_1500__mantis8900.sql @@ -0,0 +1,25 @@ +declare + object_exists exception; + pragma exception_init (object_exists , -02275); +begin + execute immediate 'ALTER TABLE PTOVTA_EMPRESA_CONTABANCARIA ADD FOREIGN KEY (EMPRESACONTABANCARIA_ID) REFERENCES EMPRESA_CONTABANCARIA (EMPRESACONTABANCARIA_ID)'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -02260); +begin + execute immediate 'ALTER TABLE PTOVTA_EMPRESA ADD CONSTRAINT PTOVTA_EMPRESA_PK PRIMARY KEY (PTOVTAEMPRESA_ID)'; + exception when object_exists then null; +end; +/ + +declare + object_exists exception; + pragma exception_init (object_exists , -02275); +begin + execute immediate 'ALTER TABLE PTOVTA_EMPRESA_CONTABANCARIA ADD FOREIGN KEY (PTOVTAEMPRESA_ID) REFERENCES PTOVTA_EMPRESA (PTOVTAEMPRESA_ID)'; + exception when object_exists then null; +end;