nyanoblog/migrations/20221205020531_create_accounts.sql

11 lines
329 B
MySQL
Raw Normal View History

2022-12-05 20:22:46 +01:00
CREATE TABLE accounts (
id SERIAL PRIMARY KEY,
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_name_and_domain ON accounts (name, domain);