mirror of
https://github.com/grocy/grocy.git
synced 2025-08-19 20:11:16 +00:00
Fixed meal plan did not load when a containing recipe was deleted (closes #361)
This commit is contained in:
9
migrations/0089.sql
Normal file
9
migrations/0089.sql
Normal file
@@ -0,0 +1,9 @@
|
||||
CREATE TRIGGER remove_recipe_from_meal_plans AFTER DELETE ON recipes
|
||||
BEGIN
|
||||
DELETE FROM meal_plan
|
||||
WHERE recipe_id = OLD.id;
|
||||
END;
|
||||
|
||||
-- Delete all recipes from the meal plan which doesn't exist anymore
|
||||
DELETE FROM meal_plan
|
||||
WHERE recipe_id NOT IN (SELECT id FROM recipes);
|
||||
Reference in New Issue
Block a user