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 695f36a8205..5144120f543 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 @@ -131,7 +131,8 @@ ALTER TABLE llx_categorie_societe DROP INDEX fk_categorie; ALTER TABLE llx_categorie_societe DROP INDEX fk_societe; ALTER TABLE llx_categorie_fournisseur DROP INDEX fk_categorie; -ALTER TABLE llx_categorie_fournisseur DROP PRIMARY KEY; +-- VMYSQL ALTER TABLE llx_categorie_fournisseur DROP PRIMARY KEY; +-- VPGSQL ALTER TABLE llx_categorie_fournisseur DROP CONSTRAINT pk_categorie_fournisseur; ALTER TABLE llx_categorie_fournisseur ADD PRIMARY KEY pk_categorie_fournisseur (fk_categorie, fk_societe); ALTER TABLE llx_categorie_fournisseur ADD INDEX idx_categorie_fournisseur_fk_categorie (fk_categorie); ALTER TABLE llx_categorie_fournisseur ADD INDEX idx_categorie_fournisseur_fk_societe (fk_societe); diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 8b090350b02..a95aefca027 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -34,6 +34,7 @@ update llx_facture_rec set fk_projet = null where fk_projet not in (select rowid update llx_fichinter set fk_projet = null where fk_projet not in (select rowid from llx_projet); update llx_projet_task set fk_projet = null where fk_projet not in (select rowid from llx_projet); +DELETE FROM llx_boxes where box_id NOT IN (SELECT rowid FROM llx_boxes_def); -- VMYSQL4.1 DELETE T1 FROM llx_boxes_def as T1, llx_boxes_def as T2 where T1.entity = T2.entity AND T1.file = T2.file AND T1.note = T2.note and T1.rowid > T2.rowid -- VPGSQL8.2 DELETE FROM llx_boxes_def as T1 WHERE rowid NOT IN (SELECT min(rowid) FROM llx_boxes_def GROUP BY file, entity, note)