aboutsummaryrefslogtreecommitdiffstats
path: root/migrations/2021-03-20-171007_create_users/up.sql
blob: 46c6a3721355be60ec9e2194ebdedb5a7a5bff6b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
-- Your SQL goes here
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));