mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Fixed some localization strings Reviewed/optimized product deletion handling Add option to hide products from the stock overview page (closes #906) Prefill default_due_days also on the inventory page (closes #591) Added DataTables accent chinese-string plugin (closes #872) Show costs and calories per recipe ingredient (closes #1072) Fixed user permission saving (fixes #1099) User permissions should not have an effect for demo mode (closes #972) Handle QU conversion when consuming a substituation (child) product (fixes #1118) Consume/open any child product when the parent product is not in stock (closes #899) Added a retry camera barcode scanning button to product picker workflow (closes #736)
26 lines
506 B
SQL
26 lines
506 B
SQL
CREATE TRIGGER cascade_product_removal AFTER DELETE ON products
|
|
BEGIN
|
|
DELETE FROM stock_log
|
|
WHERE product_id = OLD.id;
|
|
|
|
DELETE FROM product_barcodes
|
|
WHERE product_id = OLD.id;
|
|
|
|
DELETE FROM quantity_unit_conversions
|
|
WHERE product_id = OLD.id;
|
|
|
|
DELETE FROM recipes_pos
|
|
WHERE product_id = OLD.id;
|
|
|
|
UPDATE recipes
|
|
SET product_id = NULL
|
|
WHERE product_id = OLD.id;
|
|
|
|
DELETE FROM meal_plan
|
|
WHERE product_id = OLD.id
|
|
AND type = 'product';
|
|
|
|
DELETE FROM shopping_list
|
|
WHERE product_id = OLD.id;
|
|
END;
|