mirror of
https://github.com/LemmyNet/lemmy
synced 2024-12-11 13:42:45 +00:00
be1389420b
* SQL format checking, 1. * SQL format checking, 2. * SQL format checking, 3. * SQL format checking, 4. * SQL format checking, 5. * Running pg_format * Getting rid of comment. * Upping pg_format version. * Using git ls-files for sql format check. * Fixing sql lints. * Addressing PR comments.
25 lines
713 B
SQL
25 lines
713 B
SQL
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)
|
|
);
|
|
|
|
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)
|
|
);
|
|
|
|
INSERT INTO user_ (name, fedi_name, password_encrypted)
|
|
VALUES ('admin', 'TBD', 'TBD');
|
|
|