From 9c0320748916306b81fcdf90f14ee010549d12b9 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 17 May 2020 16:04:43 -0700 Subject: [PATCH] Basic sessions schema which is used as a api key cache --- server/migrations/2020-05-17-225334_sessions/down.sql | 2 ++ server/migrations/2020-05-17-225334_sessions/up.sql | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 server/migrations/2020-05-17-225334_sessions/down.sql create mode 100644 server/migrations/2020-05-17-225334_sessions/up.sql diff --git a/server/migrations/2020-05-17-225334_sessions/down.sql b/server/migrations/2020-05-17-225334_sessions/down.sql new file mode 100644 index 0000000..4d41ad6 --- /dev/null +++ b/server/migrations/2020-05-17-225334_sessions/down.sql @@ -0,0 +1,2 @@ +-- This file should undo anything in `up.sql` +DROP TABLE `sessions`; \ No newline at end of file diff --git a/server/migrations/2020-05-17-225334_sessions/up.sql b/server/migrations/2020-05-17-225334_sessions/up.sql new file mode 100644 index 0000000..acd1aeb --- /dev/null +++ b/server/migrations/2020-05-17-225334_sessions/up.sql @@ -0,0 +1,9 @@ +-- id's are given back to the user otherwise everything is server sided +-- NOTE: the expires column is not explicitly a date because the code required + -- to make the DATE field work with diesel is ass and looks annoying +CREATE TABLE IF NOT EXISTS `sessions` ( + `id` bigint UNSIGNED NOT NULL auto_increment, + `secret` varchar(255) NOT NULL, + `expires` bigint UNSIGNED NOT NULL, + PRIMARY KEY(`id`) +); \ No newline at end of file