Messages schema now contains foreign references to channel_id; not channel_name

This commit is contained in:
shockrah 2020-11-12 13:17:19 -08:00
parent c78c8a5502
commit d615a41c0c

View File

@ -4,8 +4,8 @@ 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,
`channel_id` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`author_id`) REFERENCES members(`id`),
FOREIGN KEY (`channel_name`) REFERENCES channels(`name`)
FOREIGN KEY (`channel_id`) REFERENCES channels(`id`)
);