From 6d4a8ae496163b2c9713df7e3fa6fc659fec984b Mon Sep 17 00:00:00 2001 From: Martin Mares <mj@ucw.cz> Date: Thu, 9 Apr 2020 15:33:58 +0200 Subject: [PATCH] DB: Cascading deletes --- db.ddl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db.ddl b/db.ddl index 484a304..7f45b7a 100644 --- a/db.ddl +++ b/db.ddl @@ -9,14 +9,14 @@ CREATE TABLE zoom_meetings ( mid serial PRIMARY KEY, meeting_id int UNIQUE NOT NULL, -- Zoom's meeting ID uuid varchar(255) NOT NULL, -- Zoom's meeting instance ID - host_uid int NOT NULL REFERENCES zoom_users(uid), + host_uid int NOT NULL REFERENCES zoom_users(uid) ON DELETE CASCADE, topic varchar(255) DEFAULT '', type int NOT NULL -- 1=instant, 2=scheduled, 3=recurring no time, 8=recurring fixed time ); CREATE TABLE zoom_schedule ( id serial PRIMARY KEY, - mid int NOT NULL REFERENCES zoom_meetings(mid), + mid int NOT NULL REFERENCES zoom_meetings(mid) ON DELETE CASCADE, occurrence_id bigint DEFAULT 0, -- Occurrence for recurring meetings, 0 otherwise start_time timestamp NOT NULL, duration int NOT NULL, -- minutes -- GitLab