-- Migration 156: persist the scanner repo chosen per IACE project for the
-- CRA/Cyber pull-flow (replaces the ephemeral UI dropdown selection). Keyed by
-- IACE project id so it works for any project, independent of a linked CRA
-- project. Additive + idempotent.

CREATE TABLE IF NOT EXISTS compliance_cra_scanner_repo_map (
    tenant_id        UUID NOT NULL,
    iace_project_id  UUID NOT NULL,
    scanner_repo_id  TEXT NOT NULL,
    updated_at       TIMESTAMPTZ NOT NULL DEFAULT NOW(),
    PRIMARY KEY (tenant_id, iace_project_id)
);
