CREATE TYPE raid_builder.account_status AS ENUM ( 'ACTIVE', 'LOCKED', 'INACTIVE', 'DELETED', 'UNCONFIRMED');


CREATE TABLE IF NOT EXISTS raid_builder.account(
	account_id uuid PRIMARY KEY,
	username text UNIQUE NOT NULL,
	password text NOT NULL,
	login_date timestamptz,
	email text UNIQUE NOT NULL,
	force_reset boolean NOT NULL,
	refresh_token uuid UNIQUE,
	refresh_token_expiration timestamptz,
	account_status raid_builder.account_status NOT NULL
);

CREATE INDEX idx_account_username ON raid_builder.account(username);

GRANT ALL ON TABLE raid_builder.account TO raid_builder;
