CREATE TABLE IF NOT EXISTS roles
(
    id          INTEGER PRIMARY KEY NOT NULL,
    definition  TEXT                NOT NULL
);

INSERT OR REPLACE INTO roles(id, definition) values(1, "Default");
INSERT OR REPLACE INTO roles(id, definition) values(2, "Administrator");

CREATE TABLE IF NOT EXISTS users
(
    id              INTEGER PRIMARY KEY NOT NULL,
    name            TEXT                NOT NULL,
    password_hash   TEXT                NOT NULL,
    salt            TEXT                NOT NULL,
    role_id         INTEGER             NOT NULL,
    FOREIGN KEY(role_id) REFERENCES roles(id)
);
