浏览代码

FIX #6803

Laurent Destailleur 8 年之前
父节点
当前提交
b5b97816c8
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      htdocs/install/mysql/migration/5.0.0-6.0.0.sql

+ 2 - 0
htdocs/install/mysql/migration/5.0.0-6.0.0.sql

@@ -212,7 +212,9 @@ ALTER TABLE llx_default_values ADD UNIQUE INDEX uk_default_values(type, entity,
 ALTER TABLE llx_supplier_proposaldet ADD INDEX idx_supplier_proposaldet_fk_supplier_proposal (fk_supplier_proposal);
 ALTER TABLE llx_supplier_proposaldet ADD INDEX idx_supplier_proposaldet_fk_product (fk_product);
 
+UPDATE llx_supplier_proposaldet SET fk_unit = NULL where fk_unit not in (SELECT rowid from llx_c_units);
 ALTER TABLE llx_supplier_proposaldet ADD CONSTRAINT fk_supplier_proposaldet_fk_unit FOREIGN KEY (fk_unit) REFERENCES llx_c_units (rowid);
+
 ALTER TABLE llx_supplier_proposaldet ADD CONSTRAINT fk_supplier_proposaldet_fk_supplier_proposal FOREIGN KEY (fk_supplier_proposal) REFERENCES llx_supplier_proposal (rowid);
 
 -- NEW inventory module