#1002868 IDEMPIERE-1188 Invoice Price Variance for Average PO Costing. Add missing foreign key constraint.

This commit is contained in:
Heng Sin Low 2013-09-25 12:39:57 +08:00
parent e8b984a1e8
commit 0d3b9a9b00
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,11 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
UPDATE M_CostDetail SET M_MatchInv_ID=NULL WHERE M_MatchInv_ID IS NOT NULL AND NOT EXISTS (SELECT a.M_MatchInv_ID FROM M_MatchInv a WHERE a.M_MatchInv_ID=M_CostDetail.M_MatchInv_ID)
;
ALTER TABLE M_CostDetail ADD CONSTRAINT MCostDetail_MatchInv FOREIGN KEY(M_MatchInv_ID) REFERENCES M_MatchInv(M_MatchInv_ID) ON DELETE RESTRICT
;
SELECT register_migration_script('201309250432_IDEMPIERE-1188.sql') FROM dual
;

View File

@ -0,0 +1,8 @@
UPDATE M_CostDetail SET M_MatchInv_ID=NULL WHERE M_MatchInv_ID IS NOT NULL AND NOT EXISTS (SELECT a.M_MatchInv_ID FROM M_MatchInv a WHERE a.M_MatchInv_ID=M_CostDetail.M_MatchInv_ID)
;
ALTER TABLE M_CostDetail ADD CONSTRAINT MCostDetail_MatchInv FOREIGN KEY(M_MatchInv_ID) REFERENCES M_MatchInv(M_MatchInv_ID) ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED
;
SELECT register_migration_script('201309250432_IDEMPIERE-1188.sql') FROM dual
;