From: Damyan Ivanov Date: Fri, 4 Mar 2022 20:26:27 +0000 (+0000) Subject: make the foreign key constraint "on delete cascade" X-Git-Url: https://git.ktnx.net/?p=lsl.git;a=commitdiff_plain;h=9b4106568cccde7d7f8f73ff7fb709f46590771d make the foreign key constraint "on delete cascade" --- diff --git a/sql/schema/init.sql b/sql/schema/init.sql index 3eed88d..66daf0c 100644 --- a/sql/schema/init.sql +++ b/sql/schema/init.sql @@ -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 );