From 25fb3f5bb2dceddf77eb189787940039fe9834eb Mon Sep 17 00:00:00 2001 From: shockrah Date: Wed, 18 Nov 2020 00:28:46 -0800 Subject: [PATCH] on delete cascade added to messages which hopefully makes channel deletion a bit better --- server-api/migrations/2020-07-06-022319_messages/up.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server-api/migrations/2020-07-06-022319_messages/up.sql b/server-api/migrations/2020-07-06-022319_messages/up.sql index d97f62f..8da352c 100644 --- a/server-api/migrations/2020-07-06-022319_messages/up.sql +++ b/server-api/migrations/2020-07-06-022319_messages/up.sql @@ -7,5 +7,5 @@ CREATE TABLE IF NOT EXISTS `messages`( `channel_id` BIGINT UNSIGNED NOT NULL, PRIMARY KEY (`id`), FOREIGN KEY (`author_id`) REFERENCES members(`id`), - FOREIGN KEY (`channel_id`) REFERENCES channels(`id`) + FOREIGN KEY (`channel_id`) REFERENCES channels(`id`) ON DELETE CASCADE );