Fixed mealplan-shadow recipe handling when removing an meal plan entry (references #1391)

This commit is contained in:
Bernd Bestel
2021-07-10 20:51:20 +02:00
parent 2847908523
commit 6660e1ff73

View File

@@ -162,7 +162,7 @@ BEGIN
-- Remove shadow recipes per meal plan recipe -- Remove shadow recipes per meal plan recipe
DELETE FROM recipes DELETE FROM recipes
WHERE type = 'mealplan-shadow' WHERE type = 'mealplan-shadow'
AND name NOT IN (SELECT CAST(OLD.day AS TEXT) || '#' || CAST(id AS TEXT) FROM meal_plan WHERE type = 'recipe'); AND name NOT IN (SELECT CAST(day AS TEXT) || '#' || CAST(id AS TEXT) FROM meal_plan WHERE type = 'recipe');
END; END;
CREATE TRIGGER update_internal_recipe AFTER UPDATE ON meal_plan CREATE TRIGGER update_internal_recipe AFTER UPDATE ON meal_plan