SQL Batch Scripts |
Top Previous Next |
Deleting Catgories Sometimes you want to reorganize your products into new categories. When you re-import a products.xml with newly assigned categories, the old product categories are not deleted in the mySQL database, because we must assume that you still have old (inactive) products related to these categories. To manually delete all categories of a store, use the following SQL script in HeidiSQL: DELETE c, cd, cp, cf, cs FROM oc_category c INNER JOIN oc_category_description cd ON (c.category_id=cd.category_id) LEFT JOIN oc_category_path cp ON (c.category_id=cp.category_id) LEFT JOIN oc_category_filter cf ON (c.category_id=cf.category_id) INNER JOIN oc_category_to_store cs ON (c.category_id=cs.category_id) WHERE cs.store_id=1;
|