Files
picrinth-server/tables.sql

20 lines
529 B
SQL

CREATE TABLE public.users (
id serial NOT NULL,
username text NOT NULL,
"password" text 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 public.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)
);