rag-service/migrations/003_ocr_recovery_audit.sql

9 lines
395 B
SQL

CREATE TABLE IF NOT EXISTS rag_ocr_recovery_audit (
recovery_id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
version_id uuid NOT NULL REFERENCES rag_source_versions(version_id) ON DELETE RESTRICT,
recovered_by text NOT NULL,
reason text NOT NULL,
outcome text NOT NULL CHECK (outcome IN ('closed_failed')),
error_code text NOT NULL,
created_at timestamptz NOT NULL DEFAULT now()
);