USE ca_lose;

CREATE TABLE users (
    id INT AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(100) NOT NULL UNIQUE,
    first_name VARCHAR(100) NOT NULL,
    last_name VARCHAR(100) NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE prize_draws (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL UNIQUE,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

/* This scheme does not have to be implemented manually. It always will be generated by the backend */
CREATE TABLE xx_DD_MM_YYYY (
    id INT AUTO_INCREMENT PRIMARY KEY,
    Verlosung VARCHAR(100) NOT NULL,
    Vorname VARCHAR(100) NOT NULL,
    Nachname Varchar(100) NOT NULL,
    EMail Varchar(100) NOT NULL,
    Telefonnummer Varchar(100) NOT NULL,
    Lose INT NOT NULL,
    Firmenname Varchar(100),
    Vorname_Geschaeftlich Varchar(100),
    Nachname_Geschaeftlich Varchar(100),
    EMail_Geschaeftlich Varchar(100),
    Telefonnummer_Geschaeftlich Varchar(100),
    Strasse_Hausnr Varchar(100),
    Plz_Ort Varchar(100),
    Zahlungsmethode Varchar(100),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
