Fixes #881. Remove items of deleted shopping lists.

This commit is contained in:
fipwmaqzufheoxq92ebc 2020-08-21 14:21:54 +02:00
parent fc860129ca
commit e38d17471e

10
migrations/0108.sql Normal file
View File

@ -0,0 +1,10 @@
DELETE
FROM shopping_list
WHERE shopping_list_id NOT IN (SELECT id FROM shopping_lists);
CREATE TRIGGER remove_items_from_deleted_shopping_list
AFTER DELETE
ON shopping_lists
BEGIN
DELETE FROM shopping_list WHERE shopping_list_id = OLD.id;
END;