aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/db/server-sqlite-migrations/20240621110730_create-users.sql
blob: 852c159d852a517cc6088b7e3019e8a39fe93192 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
create table users (
	id integer primary key autoincrement,               -- also store our own ID
	username text not null unique,   -- being able to contact users is useful
	email text not null unique,     -- being able to contact users is useful
	password text not null unique,
  created_at timestamp not null default (datetime('now','localtime')),
  verified_at timestamp with time zone default null
);

-- 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));