CREATE TABLE IF NOT EXISTS problem (
    id          INTEGER PRIMARY KEY,
    title       TEXT NOT NULL,
    description TEXT NOT NULL
);

CREATE TABLE IF NOT EXISTS user (
    id            INTEGER PRIMARY KEY,
    email         TEXT UNIQUE NOT NULL,
    username      TEXT UNIQUE NOT NULL,
    password_hash TEXT NOT NULL
);

CREATE TABLE IF NOT EXISTS submission (
    id         INTEGER PRIMARY KEY,
    problem_id INTEGER NOT NULL,
    user_id    INTEGER NOT NULL,
    language   TEXT NOT NULL,
    code       TEXT NOT NULL,
    validated  INTEGER NOT NULL
);
