migration.scripts: add 4_add_instance_invites

- schema.sql: add instance_invites table
This commit is contained in:
Luna Mendes 2018-11-19 00:00:07 -03:00
parent c8d12c38c9
commit 99fab19766
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,12 @@
CREATE TABLE IF NOT EXISTS instance_invites (
code text PRIMARY KEY,
created_at timestamp without time zone default (now() at time zone 'utc'),
temporary bool DEFAULT false,
expires_at timestamp without time zone,
uses bigint DEFAULT 0,
max_uses bigint DEFAULT -1
);

View File

@ -40,6 +40,21 @@ INSERT INTO user_conn_apps (id, name) VALUES (9, 'Skype');
INSERT INTO user_conn_apps (id, name) VALUES (10, 'League of Legends'); INSERT INTO user_conn_apps (id, name) VALUES (10, 'League of Legends');
CREATE TABLE IF NOT EXISTS instance_invites (
code text PRIMARY KEY,
created_at timestamp without time zone default (now() at time zone 'utc'),
temporary bool DEFAULT false,
expires_at timestamp without time zone,
uses bigint DEFAULT 0,
-- -1 means infinite uses
max_uses bigint DEFAULT -1
);
CREATE TABLE IF NOT EXISTS icons ( CREATE TABLE IF NOT EXISTS icons (
-- can be 'user', 'guild', 'emoji' -- can be 'user', 'guild', 'emoji'
scope text NOT NULL, scope text NOT NULL,