on delete cascade added to messages which hopefully makes channel deletion a bit better

This commit is contained in:
shockrah 2020-11-18 00:28:46 -08:00
parent 571f3a1630
commit 25fb3f5bb2

View File

@ -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
);