-- chat answer thumbs up/down signals (local SQLite, always available)
CREATE TABLE IF NOT EXISTS chat_feedback (
    id          TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
    rating      INTEGER NOT NULL CHECK (rating IN (1, -1)),
    question    TEXT NOT NULL DEFAULT '',
    answer      TEXT NOT NULL DEFAULT '',
    doc_ids     TEXT NOT NULL DEFAULT '[]',
    created_at  TEXT NOT NULL DEFAULT (datetime('now'))
);
