CREATE TABLE IF NOT EXISTS users (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    username TEXT NOT NULL,
    first_name TEXT NOT NULL,
    last_name TEXT NOT NULL,
    email TEXT NOT NULL,
    password_hash TEXT NOT NULL,
    is_admin INTEGER NOT NULL DEFAULT 0,
    created_at DATETIME NOT NULL,
    UNIQUE(username),
    UNIQUE(email)
);

-- Insert users from old database
INSERT OR IGNORE INTO users (username, first_name, last_name, email, password_hash, is_admin, created_at) VALUES
    ('admin', 'Admin', 'Admin', 'michael.voorhaen@gmail.com', '2y$10$/ubp7ANl54Lw5KZpgrYryeqT95780gcChi3KldkJt3.TnNNUadv2O', 1, datetime('1366220886', 'unixepoch')),
    ('an.vanherck', 'An', 'Van Herck', 'antjevanherck@hotmail.com', '$2y$10$gYm3VUnQPKsX93DGWn8BFeKGoV0O9K7e8ftdy2R1uuzw/h.iokIdO', 0, datetime('1383591308', 'unixepoch')),
    ('ann.geerts', 'Ann', 'Geerts', 'anngeerts22@hotmail.com', '$2y$10$gYm3VUnQPKsX93DGWn8BFeKGoV0O9K7e8ftdy2R1uuzw/h.iokIdO', 0, datetime('1398878296', 'unixepoch')),
    ('ann.mertens', 'Ann', 'Mertens', 'peten.mertens@telenet.be', '$2y$10$gYm3VUnQPKsX93DGWn8BFeKGoV0O9K7e8ftdy2R1uuzw/h.iokIdO', 0, datetime('1383591365', 'unixepoch')),
    ('carolien.vanoerle', 'Carolien', 'Van Oerle', 'carolienvo@gmail.com', '$2y$10$gYm3VUnQPKsX93DGWn8BFeKGoV0O9K7e8ftdy2R1uuzw/h.iokIdO', 0, datetime('1383591201', 'unixepoch')),
    ('ellen.toelen', 'Ellen', 'Toelen', 'ellentoelen@hotmail.com', '$2y$10$gYm3VUnQPKsX93DGWn8BFeKGoV0O9K7e8ftdy2R1uuzw/h.iokIdO', 0, datetime('1383591232', 'unixepoch')),
    ('jeroen.coninx', 'Jeroen', 'Coninx', 'jconinx@gmail.com', '$2y$10$gYm3VUnQPKsX93DGWn8BFeKGoV0O9K7e8ftdy2R1uuzw/h.iokIdO', 0, datetime('1383591331', 'unixepoch')),
    ('joke.maes', 'Joke', 'Maes', 'maes_joke@telenet.be', '$2y$10$gYm3VUnQPKsX93DGWn8BFeKGoV0O9K7e8ftdy2R1uuzw/h.iokIdO', 0, datetime('1383591273', 'unixepoch')),
    ('katrien.vanmellaerts', 'Katrien', 'Van Mellaerts', 'katrien.vanmellaerts@hotmail.be', '$2y$10$gYm3VUnQPKsX93DGWn8BFeKGoV0O9K7e8ftdy2R1uuzw/h.iokIdO', 0, datetime('1423546936', 'unixepoch')),
    ('leerkracht', 'Leerkracht', 'Account', 'michaelvoorhaen@gmail.com', '$2y$10$gYm3VUnQPKsX93DGWn8BFeKGoV0O9K7e8ftdy2R1uuzw/h.iokIdO', 1, datetime('1375687691', 'unixepoch')),
    ('lien.coonen', 'Lien', 'Coonen', 'liencoonen@hotmail.com', '$2y$10$gYm3VUnQPKsX93DGWn8BFeKGoV0O9K7e8ftdy2R1uuzw/h.iokIdO', 0, datetime('1476383919', 'unixepoch')),
    ('michael.voorhaen', 'Michael', 'Voorhaen', 'michael.voorhaen-k4@gmail.com', '2y$10$/ubp7ANl54Lw5KZpgrYryeqT95780gcChi3KldkJt3.TnNNUadv2O', 1, datetime('1387219352', 'unixepoch')),
    ('veerle.overloop', 'Veerle', 'Overloop', 'saels.overloop@telenet.be', '$2y$10$gYm3VUnQPKsX93DGWn8BFeKGoV0O9K7e8ftdy2R1uuzw/h.iokIdO', 1, datetime('1383591453', 'unixepoch'));

