From 7131e1acf51e3b18aeb2ce28d4b3d7dea778a8bb Mon Sep 17 00:00:00 2001 From: shockrah Date: Mon, 10 Aug 2020 17:16:08 -0700 Subject: [PATCH] new schema which ultimately simplfies things for us --- .../migrations/2020-02-04-083657_invites/up.sql | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/server/migrations/2020-02-04-083657_invites/up.sql b/server/migrations/2020-02-04-083657_invites/up.sql index 28e4c7c..f49c229 100644 --- a/server/migrations/2020-02-04-083657_invites/up.sql +++ b/server/migrations/2020-02-04-083657_invites/up.sql @@ -1,15 +1,12 @@ --- @id : id of the invite - --- @expires : unix timestamp of when that invite expries --- can be set to null which means it never expires +-- @id : id of the invite which is also its kill date -- @uses : can be null which means it doesn't have a use limit --- @max_uses : if this is null uses only ever incremented but we don't care for destroying on that parameter +-- @expires: boolean that tells wether the key expires or not + CREATE TABLE IF NOT EXISTS `invites` ( - `id` bigint UNSIGNED NOT NULL, - `expires` bigint, - `uses` integer, - `max_uses` integer, + `id` BIGINT UNIQUE NOT NULL, + `uses` BIGINT, + `expires` BOOLEAN NOT NULL, PRIMARY KEY( `id` ) );