apollo-backend/migrations/20210509191431_create_accounts.up.sql

14 lines
471 B
MySQL
Raw Normal View History

2021-05-10 00:51:15 +00:00
CREATE TABLE IF NOT EXISTS accounts (
id SERIAL PRIMARY KEY,
2021-06-24 02:19:43 +00:00
username character varying(20),
access_token character varying(64),
refresh_token character varying(64),
2021-05-10 00:51:15 +00:00
expires_at integer,
2021-06-24 02:19:43 +00:00
last_message_id character varying(32),
2021-05-10 00:51:15 +00:00
device_count integer,
last_checked_at integer
);
CREATE UNIQUE INDEX IF NOT EXISTS accounts_pkey ON accounts(id int4_ops);
CREATE UNIQUE INDEX IF NOT EXISTS accounts_username_key ON accounts(username bpchar_ops);