From 5af9d759f2d10492676a382d2cf24baf3abbb131 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 15 Jun 2015 20:54:40 -0500 Subject: [PATCH] * delete broadcast views when user is deleted (for tests) --- db/up/broadcast_notifications.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/up/broadcast_notifications.sql b/db/up/broadcast_notifications.sql index 5a7cb80aa..04616245c 100644 --- a/db/up/broadcast_notifications.sql +++ b/db/up/broadcast_notifications.sql @@ -11,7 +11,7 @@ CREATE TABLE broadcast_notifications ( CREATE TABLE broadcast_notification_views ( id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), - user_id varchar(64) NOT NULL REFERENCES users(id), + user_id varchar(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE, broadcast_notification_id varchar(64) NOT NULL REFERENCES broadcast_notifications(id) ON DELETE CASCADE, view_count INTEGER DEFAULT 0, active_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,