2021-03-21 14:04:39 -06:00
|
|
|
-- Your SQL goes here
|
|
|
|
create table users (
|
|
|
|
id bigserial primary key, -- also store our own ID
|
2021-04-13 12:14:07 -06:00
|
|
|
username varchar(32) not null unique, -- being able to contact users is useful
|
2021-03-21 14:04:39 -06:00
|
|
|
email varchar(128) not null unique, -- being able to contact users is useful
|
|
|
|
password varchar(128) not null unique
|
|
|
|
);
|
2021-04-13 12:14:07 -06:00
|
|
|
|
|
|
|
-- 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));
|