Foreign keys in messages now delete when parent key is deleted
This commit is contained in:
@@ -4,8 +4,6 @@ CREATE TABLE IF NOT EXISTS `messages`(
|
||||
`time` BIGINT NOT NULL,
|
||||
`content` VARCHAR(2048) NOT NULL,
|
||||
`author_id` BIGINT UNSIGNED NOT NULL,
|
||||
`channel_name` VARCHAR(255) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`author_id`) REFERENCES members(`id`),
|
||||
FOREIGN KEY (`channel_name`) REFERENCES channels(`name`)
|
||||
FOREIGN KEY (`author_id`) REFERENCES members(`id`) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user