From 62e0814041f3f212cddadee20033ea1aaf97f5fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Mar 2012 09:46:44 +0100 Subject: [PATCH] Fix: Removed not standard/compatible SQL. External module should not have foreign keys with standard tables. This creates dependencies and instabilities of core code. Integrity must be checked by applications for external modules, not by database. --- htdocs/install/mysql/migration/3.1.0-3.2.0.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql index f2b9a4bbe7f..80606c4f6ac 100755 --- a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql +++ b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql @@ -272,7 +272,7 @@ ALTER TABLE llx_product_extrafields ADD COLUMN import_key varchar(14); ALTER TABLE llx_societe_extrafields ADD COLUMN import_key varchar(14); -- Disable foreign key checks for external modules constraints -SET FOREIGN_KEY_CHECKS=0; +--SET FOREIGN_KEY_CHECKS=0; DROP TABLE llx_c_currencies; create table llx_c_currencies @@ -425,7 +425,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XEU' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ARP', NULL, 0, 'Pesos argentins'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'MXP', NULL, 0, 'Pesos Mexicans'); -SET FOREIGN_KEY_CHECKS=1; +--SET FOREIGN_KEY_CHECKS=1; ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_currency FOREIGN KEY (fk_currency) REFERENCES llx_c_currencies (code_iso); ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_fk_currency FOREIGN KEY (fk_currency) REFERENCES llx_c_currencies (code_iso);