From 194415225292283fc89fa03916ae9f9513d2d3e4 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 5 Jul 2020 20:48:15 -0700 Subject: [PATCH] messages schema now ready to be used --- server/migrations/2020-07-06-022319_messages/down.sql | 1 + server/migrations/2020-07-06-022319_messages/up.sql | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 server/migrations/2020-07-06-022319_messages/down.sql create mode 100644 server/migrations/2020-07-06-022319_messages/up.sql 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`) +);