From 774bf30e4cafce5d8ecdd1b601fbd34b04072db0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 May 2012 20:44:20 +0200 Subject: [PATCH] Fix: corrupted extra tables. --- htdocs/install/mysql/migration/repair.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 012f01bb2dd..d4ed30f7ce9 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -36,9 +36,15 @@ update llx_projet_task set fk_projet = null where fk_projet not in (select rowid update llx_commande set fk_user_author = null where fk_user_author not in (select rowid from llx_user); +delete from llx_societe_extrafields where fk_object not in (select rowid from llx_societe); +delete from llx_adherent_extrafields where fk_object not in (select rowid from llx_adherent); +delete from llx_product_extrafields where fk_object not in (select rowid from llx_product); +--delete from llx_societe_commerciaux where fk_soc not in (select rowid from llx_societe); + 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) +