Renaming project to json-api for clarity sake
This commit is contained in:
1
json-api/migrations/2020-07-06-022319_messages/down.sql
Normal file
1
json-api/migrations/2020-07-06-022319_messages/down.sql
Normal file
@@ -0,0 +1 @@
|
||||
DROP TABLE `messages`;
|
||||
11
json-api/migrations/2020-07-06-022319_messages/up.sql
Normal file
11
json-api/migrations/2020-07-06-022319_messages/up.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
-- 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(2048) 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
|
||||
);
|
||||
Reference in New Issue
Block a user