2023-08-02 12:44:51 -04:00
|
|
|
CREATE TABLE user_ (
|
|
|
|
id serial PRIMARY KEY,
|
|
|
|
name varchar(20) NOT NULL,
|
|
|
|
fedi_name varchar(40) NOT NULL,
|
|
|
|
preferred_username varchar(20),
|
|
|
|
password_encrypted text NOT NULL,
|
|
|
|
email text UNIQUE,
|
|
|
|
icon bytea,
|
|
|
|
admin boolean DEFAULT FALSE NOT NULL,
|
|
|
|
banned boolean DEFAULT FALSE NOT NULL,
|
|
|
|
published timestamp NOT NULL DEFAULT now(),
|
|
|
|
updated timestamp,
|
|
|
|
UNIQUE (name, fedi_name)
|
2019-04-03 02:49:32 -04:00
|
|
|
);
|
|
|
|
|
2023-08-02 12:44:51 -04:00
|
|
|
CREATE TABLE user_ban (
|
|
|
|
id serial PRIMARY KEY,
|
|
|
|
user_id int REFERENCES user_ ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
|
|
|
|
published timestamp NOT NULL DEFAULT now(),
|
|
|
|
UNIQUE (user_id)
|
2019-04-15 19:12:06 -04:00
|
|
|
);
|
|
|
|
|
2023-08-02 12:44:51 -04:00
|
|
|
INSERT INTO user_ (name, fedi_name, password_encrypted)
|
|
|
|
VALUES ('admin', 'TBD', 'TBD');
|
|
|
|
|