aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/db/server-pg-migrations/20210425153757_create_users.sql
blob: a25dcced64ac28834b52bb7b05aeeb68c6c251fd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
create table users (
	id bigserial primary key,               -- also store our own ID
	username varchar(32) not null unique,   -- being able to contact users is useful
	email varchar(128) not null unique,     -- being able to contact users is useful
	password varchar(128) not null unique
);

-- the prior index is case sensitive :(
CREATE UNIQUE INDEX email_unique_idx on users (LOWER(email));
CREATE UNIQUE INDEX username_unique_idx on users (LOWER(username));