diff --git a/mysql/migration/2.1.0-2.2.0.sql b/mysql/migration/2.1.0-2.2.0.sql index e8ca0fb3ed1..0fea644a936 100644 --- a/mysql/migration/2.1.0-2.2.0.sql +++ b/mysql/migration/2.1.0-2.2.0.sql @@ -752,3 +752,7 @@ update llx_product_fournisseur_price set unitprice = ROUND(price/quantity,8) whe update llx_fichinter set tms=datec where tms < datec; update llx_fichinter set tms=date_valid where tms < date_valid; +ALTER TABLE llx_commande_fournisseur DROP INDEX ref; +ALTER TABLE llx_commande_fournisseur ADD UNIQUE INDEX uk_commande_fournisseur_ref (ref, fk_soc); + + diff --git a/mysql/tables/llx_commande_fournisseur.key.sql b/mysql/tables/llx_commande_fournisseur.key.sql index 399304b857d..f0b35a84ba8 100644 --- a/mysql/tables/llx_commande_fournisseur.key.sql +++ b/mysql/tables/llx_commande_fournisseur.key.sql @@ -1,5 +1,5 @@ -- ============================================================================ --- Copyright (C) 2006 Laurent Destailleur +-- Copyright (C) 2006-2007 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 @@ -24,5 +24,7 @@ -- Supprimme orphelins pour permettre montée de la clé -- V4 DELETE llx_commande_fournisseur FROM llx_commande_fournisseur LEFT JOIN llx_societe ON llx_commande_fournisseur.fk_soc = llx_societe.rowid WHERE llx_societe.rowid IS NULL; +ALTER TABLE llx_commande_fournisseur ADD UNIQUE INDEX uk_commande_fournisseur_ref (ref, fk_soc); + ALTER TABLE llx_commande_fournisseur ADD INDEX idx_commande_fournisseur_fk_soc (fk_soc); ALTER TABLE llx_commande_fournisseur ADD CONSTRAINT fk_commande_fournisseur_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid); diff --git a/mysql/tables/llx_commande_fournisseur.sql b/mysql/tables/llx_commande_fournisseur.sql index 2f8f5bb535e..05f8f9fad93 100644 --- a/mysql/tables/llx_commande_fournisseur.sql +++ b/mysql/tables/llx_commande_fournisseur.sql @@ -1,5 +1,6 @@ -- =================================================================== -- Copyright (C) 2004 Rodolphe Quiedeville +-- Copyright (C) 2007 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 @@ -47,7 +48,5 @@ create table llx_commande_fournisseur note_public text, model_pdf varchar(50), - fk_methode_commande integer default 0, - - UNIQUE INDEX (ref) + fk_methode_commande integer default 0 )type=innodb; diff --git a/mysql/tables/llx_facture_fourn.sql b/mysql/tables/llx_facture_fourn.sql index bb416bba3aa..71646d2e30f 100644 --- a/mysql/tables/llx_facture_fourn.sql +++ b/mysql/tables/llx_facture_fourn.sql @@ -1,5 +1,6 @@ -- =========================================================================== -- Copyright (C) 2001-2003 Rodolphe Quiedeville +-- Copyright (C) 2007 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