CREATE TABLE image_replays ( id uuid PRIMARY KEY, job_id uuid NOT NULL REFERENCES image_jobs(id), event text NOT NULL CHECK (event IN ('retry_failed', 'new_version')), recorded_at timestamptz NOT NULL DEFAULT clock_timestamp() );