From d9a6ea30a759c2f6b7ef4471dd2ee2ec2db69ffb Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 21 Jul 2020 14:30:23 -0700 Subject: [PATCH] invites now has a max_uses column and less strict column requirements --- server/migrations/2020-02-04-083657_invites/up.sql | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/server/migrations/2020-02-04-083657_invites/up.sql b/server/migrations/2020-02-04-083657_invites/up.sql index f2651cd..28e4c7c 100644 --- a/server/migrations/2020-02-04-083657_invites/up.sql +++ b/server/migrations/2020-02-04-083657_invites/up.sql @@ -1,7 +1,15 @@ --- Your SQL goes here +-- @id : id of the invite + +-- @expires : unix timestamp of when that invite expries +-- can be set to null which means it never expires + +-- @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 CREATE TABLE IF NOT EXISTS `invites` ( `id` bigint UNSIGNED NOT NULL, - `expires` bigint UNSIGNED NOT NULL, - `uses` integer NOT NULL, + `expires` bigint, + `uses` integer, + `max_uses` integer, PRIMARY KEY( `id` ) );