
CREATE TABLE IF NOT EXISTS menus (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    entree VARCHAR(255) NOT NULL,
    plat VARCHAR(255) NOT NULL,
    dessert VARCHAR(255) NOT NULL,
    entree_alternative VARCHAR(255) NOT NULL,
    plat_alternative VARCHAR(255) NOT NULL,
    dessert_alternative VARCHAR(255) NOT NULL,
    concerned_day DATE DEFAULT CURRENT_DATE
);

CREATE TABLE IF NOT EXISTS users (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    firstname VARCHAR(255) NOT NULL,
    lastname VARCHAR(255) NOT NULL,
    hashed_password VARCHAR(40) NOT NULL,
    society VARCHAR(255) DEFAULT "ovh",
    BP VARCHAR(5) NOT NULL,
    address VARCHAR(255) NOT NULL,
    administrator SMALLINT DEFAULT 0
);

CREATE TABLE IF NOT EXISTS orders (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    id_user INTEGER NOT NULL,
    entree VARCHAR(255) NOT NULL,
    plat VARCHAR(255) NOT NULL,
    dessert VARCHAR(255) NOT NULL,
    comments TEXT,
    concerned_day DATE DEFAULT CURRENT_DATE
);

CREATE TABLE IF NOT EXISTS config (
    key VARCHAR(255)  NOT NULL,
    value VARCHAR(255) NOT NULL
);
