freechat/server/migrations/2020-07-06-022319_messages/up.sql
2020-07-05 20:48:15 -07:00

10 lines
307 B
SQL

CREATE TABLE IF NOT EXISTS `messages`(
`id` BIGINT UNSIGNED NOT NULL,
`content` VARCHAR(2048),
`author_id` BIGINT UNSIGNED NOT NULL,
`channel_id` BIGINT UNSIGNED NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`author_id`) REFERENCES members(`id`),
FOREIGN KEY (`channel_id`) REFERENCES channels(`id`)
);