πSQL Tips & Tricks (shopware 6)
Note: DO NOT USE IN PRODUCTION ENVIRONMENT
Delete all products
With the following query, you can delete all created products and empty the product overview completely.
delete pv.*, pt2.*, pt.*, psk.*, pr.*, pp2.*, pp.*, po.*, pm.*, pcfs.*, pcst.*, pcsap.*, pcs2.*, pcs.*, pct.*, pc.*, p.* from product p
left join product_category pc on p.id = pc.product_id
left join product_category_tree pct on p.id = pct.product_id
left join product_configurator_setting pcs on p.id = pcs.product_id
left join product_cross_selling pcs2 on p.id = pcs2.product_id
left join product_cross_selling_assigned_products pcsap on p.id = pcsap.product_id
left join product_cross_selling_translation pcst on pcs2.id = pcst.product_cross_selling_id
left join product_custom_field_set pcfs on p.id = pcfs.product_id
left join product_media pm on p.id = pm.product_id
left join product_option po on p.id = po.product_id
left join product_price pp on p.id = pp.product_id
left join product_property pp2 on p.id = pp2.product_id
left join product_review pr on p.id = pr.product_id
left join product_search_keyword psk on p.id = psk.product_id
left join product_tag pt on p.id = pt.product_id
left join product_translation pt2 on p.id = pt2.product_id
left join product_visibility pv on p.id = pv.product_id;Delete all properties
With the following query, you can remove all properties.
Delete all orders
Disable non-standard extensions
With the following queries you can deactivate the extensions that are not already present when installing Shopware. This is especially useful for debugging errors, as you can quickly eliminate the influence of extensions. If you use your own theme that is integrated via a plug-in, you should make sure in advance that the theme is not assigned to a sales channel. Alternatively, you may encounter problems when calling the appropriate sales channels. First we create a temporary backup table. The current status of the extensions is saved in this table.
Then you can deactivate the extensions
The original state of the extensions can be restored later as follows
Finally, you can delete the temporary backup table
Last updated