
CREATE TABLE user (
	user_id TEXT NOT NULL UNIQUE PRIMARY KEY,

	email TEXT NOT NULL UNIQUE,
	email_verified BOOLEAN NOT NULL,
	email_verified_at DATETIME,

	is_admin BOOLEAN NOT NULL,

	password BLOB NOT NULL,
	salt BLOB NOT NULL,

	created_at DATETIME NOT NULL
) WITHOUT ROWID;

CREATE TABLE session (
	session_id TEXT NOT NULL UNIQUE PRIMARY KEY,
	user_id TEXT NOT NULL,

	created_at DATETIME NOT NULL,
	expires_at DATETIME NOT NULL
) WITHOUT ROWID;


CREATE TABLE token (
	token TEXT NOT NULL UNIQUE PRIMARY KEY,

	user_id TEXT,
	session_id TEXT,

	type TEXT NOT NULL,

	created_at DATETIME NOT NULL,
	expires_at DATETIME
);

CREATE TABLE workout (
	user_id INTEGER NOT NULL,
	date TEXT NOT NULL,
	type TEXT NOT NULL,
	sets INTEGER NOT NULL,
	reps INTEGER NOT NULL
);
