From 144cc95db8d90267a7a03d9304c5056c2db09b76 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 29 Oct 2016 12:30:49 +0200 Subject: [PATCH] Add new foreign keys --- migration/i3.1z/oracle/201610291223_NewFKs.sql | 9 +++++++++ migration/i3.1z/postgresql/201610291223_NewFKs.sql | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 migration/i3.1z/oracle/201610291223_NewFKs.sql create mode 100644 migration/i3.1z/postgresql/201610291223_NewFKs.sql diff --git a/migration/i3.1z/oracle/201610291223_NewFKs.sql b/migration/i3.1z/oracle/201610291223_NewFKs.sql new file mode 100644 index 0000000000..4496c00f67 --- /dev/null +++ b/migration/i3.1z/oracle/201610291223_NewFKs.sql @@ -0,0 +1,9 @@ +ALTER TABLE AD_Package_Imp_Detail ADD CONSTRAINT ADPackageImp_ADPackageImpDetai FOREIGN KEY (AD_Package_Imp_ID) REFERENCES AD_Package_Imp DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE AD_Package_Imp_Detail ADD CONSTRAINT ADTable_ADPackageImpDetail FOREIGN KEY (AD_Table_ID) REFERENCES AD_Table DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE AD_Password_History ADD CONSTRAINT ADUser_ADPasswordHistory FOREIGN KEY (AD_User_ID) REFERENCES AD_User DEFERRABLE INITIALLY DEFERRED; + +SELECT register_migration_script('201610291223_NewFKs.sql') FROM dual +; + diff --git a/migration/i3.1z/postgresql/201610291223_NewFKs.sql b/migration/i3.1z/postgresql/201610291223_NewFKs.sql new file mode 100644 index 0000000000..4496c00f67 --- /dev/null +++ b/migration/i3.1z/postgresql/201610291223_NewFKs.sql @@ -0,0 +1,9 @@ +ALTER TABLE AD_Package_Imp_Detail ADD CONSTRAINT ADPackageImp_ADPackageImpDetai FOREIGN KEY (AD_Package_Imp_ID) REFERENCES AD_Package_Imp DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE AD_Package_Imp_Detail ADD CONSTRAINT ADTable_ADPackageImpDetail FOREIGN KEY (AD_Table_ID) REFERENCES AD_Table DEFERRABLE INITIALLY DEFERRED; + +ALTER TABLE AD_Password_History ADD CONSTRAINT ADUser_ADPasswordHistory FOREIGN KEY (AD_User_ID) REFERENCES AD_User DEFERRABLE INITIALLY DEFERRED; + +SELECT register_migration_script('201610291223_NewFKs.sql') FROM dual +; +