From 52e58f10c3d40dbf635fbf0ce8384cb77205e87a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alo=C3=AFs=20Micard?= Date: Fri, 9 Jun 2023 11:11:22 +0200 Subject: [PATCH] Handle migration --- htdocs/install/mysql/migration/17.0.0-18.0.0.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql index a2d1267c81e..ef728cde87b 100644 --- a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql +++ b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql @@ -460,3 +460,9 @@ insert into llx_c_invoice_subtype (entity, fk_country, code, label, active) VALU ALTER TABLE llx_partnership ADD COLUMN email_partnership varchar(64) after fk_member; ALTER TABLE llx_contratdet ADD INDEX idx_contratdet_statut (statut); + +-- Drop the composite unique index that exists on llx_commande_fournisseur to rebuild a new one without the fk_soc. +-- The old design allowed for a duplicate reference as long as fk_soc was not the same. +-- VMYSQL4.1 DROP INDEX uk_commande_fournisseur_ref on llx_commande_fournisseur; +-- VPGSQL8.2 DROP INDEX uk_commande_fournisseur_ref; +ALTER TABLE llx_commande_fournisseur ADD UNIQUE INDEX uk_commande_fournisseur_ref (ref, entity);