Files
picrinth-server/tables.sql

22 lines
598 B
SQL

CREATE TABLE picrinth.users (
id serial not null,
username text not null,
"password" text not null,
"role" text not null default "user",
"disabled" bool not null,
groups_ids integer[] NULL,
last_seen_at timestamp with time zone NULL,
created_at timestamp with time zone NULL,
CONSTRAINT userid_pk PRIMARY KEY (id),
CONSTRAINT username_unique UNIQUE (username)
);
CREATE TABLE picrinth.groups (
id serial not null,
groupname text not null,
join_code text not null,
users_ids integer[] null,
created_at timestamp with time zone null,
CONSTRAINT groupname_unique UNIQUE (username)
);