diff --git a/mysql/migration/2.0.0-2.1.0.sql b/mysql/migration/2.0.0-2.1.0.sql index 00ffae49d54..2bbf2cb02e8 100644 --- a/mysql/migration/2.0.0-2.1.0.sql +++ b/mysql/migration/2.0.0-2.1.0.sql @@ -224,6 +224,7 @@ create table llx_livraison fk_adresse_livraison integer, UNIQUE INDEX (ref) + key(fk_commande) )type=innodb; alter table llx_livraison drop column fk_soc; diff --git a/mysql/tables/llx_livraison.key.sql b/mysql/tables/llx_livraison.key.sql deleted file mode 100644 index a4988ec33a0..00000000000 --- a/mysql/tables/llx_livraison.key.sql +++ /dev/null @@ -1,28 +0,0 @@ --- ============================================================================ --- Copyright (C) 2006 Laurent Destailleur --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --- --- $Id$ --- $Source$ --- --- ============================================================================ - - --- Supprimme orphelins pour permettre montée de la clé --- V4 DELETE llx_livraison FROM llx_livraison LEFT JOIN llx_societe ON llx_livraison.fk_soc = llx_societe.idp WHERE llx_societe.idp IS NULL; - -ALTER TABLE llx_livraison ADD INDEX idx_livraison_fk_soc (fk_soc); -ALTER TABLE llx_livraison ADD CONSTRAINT fk_livraison_societe FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp); diff --git a/mysql/tables/llx_livraison.sql b/mysql/tables/llx_livraison.sql index 900306f680a..cdc34a6a664 100644 --- a/mysql/tables/llx_livraison.sql +++ b/mysql/tables/llx_livraison.sql @@ -41,4 +41,5 @@ create table llx_livraison fk_adresse_livraison integer, -- adresse de livraison UNIQUE INDEX (ref) + key(fk_commande) )type=innodb;