
BEGIN;

CREATE TABLE IF NOT EXISTS schema_version (
    version TEXT PRIMARY KEY,
    applied_at TEXT NOT NULL DEFAULT (datetime('now'))
);

CREATE TABLE users (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    date_create TEXT NOT NULL DEFAULT (datetime('now')),
    username TEXT UNIQUE NOT NULL,
    password_hash BLOB NOT NULL,
    role TEXT NOT NULL DEFAULT 'guest'

);

INSERT INTO schema_version (version) VALUES ('20251128_210200_initial');

COMMIT;
