apollo-backend/migrations/20210509191431_create_accounts.up.sql
Andre Medeiros 7fad5ac9e4 initial pass
2021-05-09 20:51:15 -04:00

13 lines
439 B
SQL

CREATE TABLE IF NOT EXISTS accounts (
id SERIAL PRIMARY KEY,
username character(20),
access_token character(64),
refresh_token character(64),
expires_at integer,
last_message_id character(32),
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);