nyanoblog/migrations/20221205020531_create_accounts.sql

14 lines
445 B
MySQL
Raw Normal View History

2022-12-05 20:22:46 +01:00
CREATE TABLE accounts (
id BIGSERIAL PRIMARY KEY,
2022-12-25 15:57:33 +01:00
iri VARCHAR,
2022-12-05 20:22:46 +01:00
name VARCHAR NOT NULL,
domain VARCHAR NOT NULL,
display_name VARCHAR DEFAULT NULL,
2023-01-20 19:24:32 +01:00
public_key bytea DEFAULT NULL,
2022-12-05 20:22:46 +01:00
created_at TIMESTAMP NOT NULL DEFAULT now(),
updated_at TIMESTAMP NOT NULL DEFAULT now()
2022-12-05 20:22:46 +01:00
);
2022-12-25 15:57:33 +01:00
CREATE UNIQUE INDEX index_accounts_on_iri ON accounts (iri);
2022-12-05 20:22:46 +01:00
CREATE UNIQUE INDEX index_accounts_on_name_and_domain ON accounts (name, domain);