diff --git a/server/migrations/2020-07-06-022319_messages/down.sql b/server/migrations/2020-07-06-022319_messages/down.sql new file mode 100644 index 0000000..cefcae0 --- /dev/null +++ b/server/migrations/2020-07-06-022319_messages/down.sql @@ -0,0 +1 @@ +DROP TABLE `messages`; diff --git a/server/migrations/2020-07-06-022319_messages/up.sql b/server/migrations/2020-07-06-022319_messages/up.sql new file mode 100644 index 0000000..1488872 --- /dev/null +++ b/server/migrations/2020-07-06-022319_messages/up.sql @@ -0,0 +1,9 @@ +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`) +);