Fix: Corrige la clé unique sur les commandes fournisseurs.

This commit is contained in:
Laurent Destailleur 2007-07-12 22:53:13 +00:00
parent 18751c72c1
commit e7ba142fde
4 changed files with 10 additions and 4 deletions

View File

@ -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=datec where tms < datec;
update llx_fichinter set tms=date_valid where tms < date_valid; 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);

View File

@ -1,5 +1,5 @@
-- ============================================================================ -- ============================================================================
-- Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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é -- 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; -- 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 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); ALTER TABLE llx_commande_fournisseur ADD CONSTRAINT fk_commande_fournisseur_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);

View File

@ -1,5 +1,6 @@
-- =================================================================== -- ===================================================================
-- Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- 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, note_public text,
model_pdf varchar(50), model_pdf varchar(50),
fk_methode_commande integer default 0, fk_methode_commande integer default 0
UNIQUE INDEX (ref)
)type=innodb; )type=innodb;

View File

@ -1,5 +1,6 @@
-- =========================================================================== -- ===========================================================================
-- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- it under the terms of the GNU General Public License as published by