2023-08-02 16:44:51 +00: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 06:49:32 +00:00
|
|
|
);
|
|
|
|
|
2023-08-02 16:44:51 +00: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 23:12:06 +00:00
|
|
|
);
|
|
|
|
|
2023-08-02 16:44:51 +00:00
|
|
|
INSERT INTO user_ (name, fedi_name, password_encrypted)
|
|
|
|
VALUES ('admin', 'TBD', 'TBD');
|
|
|
|
|