CREATE TABLE IF NOT EXISTS users (
    id INTEGER PRIMARY KEY NOT NULL,
    name TEXT NOT NULL,
    password TEXT
);

CREATE TABLE IF NOT EXISTS user_kv (
   id INTEGER PRIMARY KEY NOT NULL,
   user INTEGER NOT NULL,
   key TEXT NOT NULL,
   value BLOB NOT NULL,
   FOREIGN KEY (user) REFERENCES users(id)
);

CREATE TABLE IF NOT EXISTS user_roles (
    id INTEGER PRIMARY KEY NOT NULL,
    user INTEGER NOT NULL,
    role TEXT NOT NULL,
    FOREIGN KEY (user) REFERENCES users(id)
);
