freechat/json-api/migrations/2020-07-06-022319_messages/up.sql
shockrah 9ce04e96a7 Query string parameter 'type' is now enforced by the api
+ Flag is literally called 'type'
2021-03-12 02:17:06 -08:00

13 lines
441 B
SQL

-- Time stamp is _not_ in ms
CREATE TABLE IF NOT EXISTS `messages`(
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`time` BIGINT NOT NULL,
`content` VARCHAR(4096) NOT NULL,
`content_type` VARCHAR(10) NOT NULL,
`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`) ON DELETE CASCADE
);