CREATE TABLE IF NOT EXISTS dsw (
    csa INTEGER,
    date TEXT NOT NULL,
    wa TEXT NOT NULL,
    driver TEXT,
    totalod TEXT,
    nextod TEXT,
    delstops INTEGER,
    delpkgs INTEGER,
    pustops INTEGER,
    pupkgs INTEGER,
    van INTEGER,
    miles INTEGER,
    ils TEXT,
    dna INTEGER,
    allstatus INTEGER,
    PRIMARY KEY (date,wa)
);

CREATE TABLE IF NOT EXISTS totals (
    entity TEXT NOT NULL,
    date TEXT NOT NULL,
    prepkgs INTEGER,
    prestops INTEGER,
    prepustops INTEGER,
    delstops INTEGER,
    delpkgs INTEGER,
    pustops INTEGER,
    pupkgs INTEGER,
    ils TEXT,
    dna INTEGER,
    allstatus INTEGER,
    sig INTEGER,
    eve INTEGER,
    appt INTEGER,
    PRIMARY KEY(entity,date)
);

CREATE TABLE IF NOT EXISTS users (
    userid INTEGER NOT NULL PRIMARY KEY,
    email TEXT UNIQUE NOT NULL,
    password TEXT NOT NULL
);
