-- SQLite
PRAGMA foreign_keys = ON;

CREATE TABLE Users (
    Id INTEGER PRIMARY KEY ASC AUTOINCREMENT,
    Email TEXT UNIQUE NOT NULL,
    Pass TEXT NOT NULL,
    Username TEXT DEFAULT "joe",
    Submissions INTEGER DEFAULT 0
);

CREATE TABLE Rooms (
    Id INTEGER PRIMARY KEY ASC AUTOINCREMENT,
    RoomName TEXT
);

CREATE TABLE TimeSlots (
    Id INTEGER PRIMARY KEY ASC AUTOINCREMENT,
    Period INTEGER,
    Day INTEGER,
    Room INTEGER,
    FOREIGN KEY(Room) REFERENCES Rooms(Id)
);