CREATE TABLE users (
    id BIGSERIAL PRIMARY KEY,
    account_id BIGINT REFERENCES accounts (id),
    email VARCHAR NOT NULL,
    password VARCHAR NOT NULL,
    reason VARCHAR DEFAULT NULL,
    activated BOOLEAN NOT NULL DEFAULT FALSE,
    locale VARCHAR NOT NULL,
    private_key bytea NOT NULL
);

CREATE UNIQUE INDEX index_users_on_email ON users (email);
