nyanoblog/migrations/20221205020531_create_accounts.sql
2022-12-25 15:57:33 +01:00

12 lines
410 B
SQL

CREATE TABLE accounts (
id BIGSERIAL PRIMARY KEY,
iri VARCHAR,
name VARCHAR NOT NULL,
domain VARCHAR NOT NULL,
display_name VARCHAR DEFAULT NULL,
created_at TIMESTAMP NOT NULL DEFAULT now(),
updated_at TIMESTAMP NOT NULL DEFAULT now()
);
CREATE UNIQUE INDEX index_accounts_on_iri ON accounts (iri);
CREATE UNIQUE INDEX index_accounts_on_name_and_domain ON accounts (name, domain);