CREATE TABLE IF NOT EXISTS dod_evidence (
    id            TEXT PRIMARY KEY,
    dod_item_id   TEXT NOT NULL,
    kind          TEXT NOT NULL DEFAULT 'text',
    payload_path  TEXT,
    payload_url   TEXT,
    payload_text  TEXT,
    attached_at   INTEGER NOT NULL,
    validated_at  INTEGER,
    validated_by  TEXT,
    FOREIGN KEY (dod_item_id) REFERENCES dod_items(id) ON DELETE CASCADE
);

CREATE INDEX IF NOT EXISTS idx_dod_evidence_item ON dod_evidence(dod_item_id);
