diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 8c334f9966db37e0d72748f61765f4fb0faa351d..4083ba2f7b90c56a3f1bebb741a6d21ce746c84d 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -189,9 +189,12 @@ UPDATE llx_projet_task_time set task_datehour = task_date where task_datehour IS -- update llx_facture set tva = total_ttc - total where tva = 0; -- To insert elements into a category --- Search idcategory: select rowid from llx_categorie where type=0 and label like '%xxx%' --- Select all products to include: select * from llx_product where label like '%xxx%' --- If ok, insert: insert into llx_categorie_product(fk_categorie, fk_product) select idcategory, rowid from llx_product where label like '%xxx%' +-- Search idcategory: select rowid from llx_categorie where type=0 and ref like '%xxx%' +-- Select all products to include: select * from llx_product where ref like '%xxx%' +-- If ok, insert: insert into llx_categorie_product(fk_categorie, fk_product) select idcategory, rowid from llx_product where ref like '%xxx%' +-- List of product with a category xxx: select distinct cp.fk_product from llx_categorie_product as cp, llx_categorie as c where cp.fk_categorie = c.rowid and c.label like 'xxx-%' order by fk_product; +-- List of product into 2 categories xxx: select cp.fk_product, count(cp.fk_product) as nb from llx_categorie_product as cp, llx_categorie as c where cp.fk_categorie = c.rowid and c.label like 'xxx-%' group by fk_product having nb > 1; +-- List of product with no category xxx yet: select rowid, ref from llx_product where rowid not in (select distinct cp.fk_product from llx_categorie_product as cp, llx_categorie as c where cp.fk_categorie = c.rowid and c.label like 'xxx-%' order by fk_product); -- Replace xxx with your IP Address -- bind-address = xxx.xxx.xxx.xxx