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