CREATE TABLE IF NOT EXISTS users (
    id          INTEGER PRIMARY KEY AUTOINCREMENT,
    username    TEXT NOT NULL UNIQUE COLLATE NOCASE,
    email       TEXT NOT NULL UNIQUE COLLATE NOCASE,
    password    TEXT NOT NULL,
    bio         TEXT,
    avatar_url  TEXT,
    role        TEXT NOT NULL DEFAULT 'member' CHECK(role IN ('member', 'admin')),
    created_at  DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
