]> git.ktnx.net Git - lsl.git/blobdiff - sql/schema/init.sql
make the foreign key constraint "on delete cascade"
[lsl.git] / sql / schema / init.sql
index 3eed88d8c4b096863182926c1c59b0544e7da88c..66daf0c53298a56b91589f162e0891efacdeba7e 100644 (file)
@@ -11,7 +11,9 @@ create table shopping_lists(
 
 create table shopping_list_items(
     id bigserial primary key,
-    shopping_list bigint not null references shopping_lists(id),
+    shopping_list bigint not null
+        references shopping_lists(id)
+        on delete cascade,
     description text not null,
     version bigint not null default 1,
     done boolean not null default false );