core-jgi/migration/i1.0a-release/postgresql/201304241229_Release_FKs.sql

49 lines
2.5 KiB
SQL

ALTER TABLE A_Asset_Addition ADD CONSTRAINT CDocType_AAssetAddition FOREIGN KEY (C_DocType_ID) REFERENCES C_DocType DEFERRABLE INITIALLY DEFERRED
;
ALTER TABLE A_Asset_Disposed ADD CONSTRAINT CDocType_AAssetDisposed FOREIGN KEY (C_DocType_ID) REFERENCES C_DocType DEFERRABLE INITIALLY DEFERRED
;
ALTER TABLE I_FAJournal ADD CONSTRAINT CLocFrom_IFAJournal FOREIGN KEY (C_LocFrom_ID) REFERENCES C_Location DEFERRABLE INITIALLY DEFERRED
;
ALTER TABLE I_FAJournal ADD CONSTRAINT CLocTo_IFAJournal FOREIGN KEY (C_LocTo_ID) REFERENCES C_Location DEFERRABLE INITIALLY DEFERRED
;
ALTER TABLE I_ProductPlanning ADD CONSTRAINT SalesRep_IProductPlanning FOREIGN KEY (SalesRep_ID) REFERENCES AD_User DEFERRABLE INITIALLY DEFERRED
;
ALTER TABLE I_ProductPlanning ADD CONSTRAINT ADWorkflow_IProductPlanning FOREIGN KEY (AD_Workflow_ID) REFERENCES AD_Workflow DEFERRABLE INITIALLY DEFERRED
;
ALTER TABLE I_ProductPlanning ADD CONSTRAINT DDNetworkDistribution_IProduct FOREIGN KEY (DD_NetworkDistribution_ID) REFERENCES DD_NetworkDistribution DEFERRABLE INITIALLY DEFERRED
;
ALTER TABLE M_CommodityShipment ADD CONSTRAINT CountryOfManufacture_MCommodit FOREIGN KEY (CountryOfManufacture_ID) REFERENCES C_Country DEFERRABLE INITIALLY DEFERRED
;
ALTER TABLE M_Package ADD CONSTRAINT HoldAddress_MPackage FOREIGN KEY (HoldAddress_ID) REFERENCES C_BPartner_Location DEFERRABLE INITIALLY DEFERRED
;
ALTER TABLE M_ShippingTransaction ADD CONSTRAINT HoldAddress_MShippingTransacti FOREIGN KEY (HoldAddress_ID) REFERENCES C_BPartner_Location DEFERRABLE INITIALLY DEFERRED
;
ALTER TABLE A_Asset_Acct ADD CONSTRAINT AAssetvc_AAssetAcct FOREIGN KEY(A_Asset_Acct) REFERENCES C_ValidCombination(C_ValidCombination_ID) DEFERRABLE INITIALLY DEFERRED
;
ALTER TABLE A_Asset_Acct ADD CONSTRAINT ADepreciationvc_AAssetAcct FOREIGN KEY(A_Depreciation_Acct) REFERENCES C_ValidCombination(C_ValidCombination_ID) DEFERRABLE INITIALLY DEFERRED
;
ALTER TABLE A_Asset_Change ADD CONSTRAINT AAssetvc_AAssetChange FOREIGN KEY(A_Asset_Acct) REFERENCES C_ValidCombination(C_ValidCombination_ID) DEFERRABLE INITIALLY DEFERRED
;
ALTER TABLE A_Asset_Group_Acct ADD CONSTRAINT ADepreciationvc_AAssetGroupAcc FOREIGN KEY(A_Depreciation_Acct) REFERENCES C_ValidCombination(C_ValidCombination_ID) DEFERRABLE INITIALLY DEFERRED
;
ALTER TABLE A_Asset_Transfer ADD CONSTRAINT AAssetvc_AAssetTransfer FOREIGN KEY(A_Asset_Acct) REFERENCES C_ValidCombination(C_ValidCombination_ID) DEFERRABLE INITIALLY DEFERRED
;
SELECT register_migration_script('201304241229_Release_FKs.sql') FROM dual
;