flabk/migrate/1662887862_schema.up.sql

11 lines
257 B
MySQL
Raw Normal View History

2022-09-11 16:52:37 +01:00
CREATE TABLE users (
id CHAR(22) NOT NULL PRIMARY KEY,
username TEXT NOT NULL,
host TEXT,
display_name TEXT
);
CREATE UNIQUE INDEX u_username_host ON users (username, host);
CREATE UNIQUE INDEX u_username_local ON users (username) WHERE host IS NULL;