CREATE TABLE IF NOT EXISTS dod_items (
    id          TEXT PRIMARY KEY,
    run_id      TEXT NOT NULL,
    item_key    TEXT NOT NULL,
    kind        TEXT NOT NULL DEFAULT 'manual',
    expected    TEXT NOT NULL DEFAULT '',
    required    INTEGER NOT NULL DEFAULT 1,
    status      TEXT NOT NULL DEFAULT 'pending',
    created_at  INTEGER NOT NULL,
    FOREIGN KEY (run_id) REFERENCES runs(id) ON DELETE CASCADE
);

CREATE INDEX IF NOT EXISTS idx_dod_items_run ON dod_items(run_id);
CREATE INDEX IF NOT EXISTS idx_dod_items_status ON dod_items(status);
