-- Migration: 00014_add_threat_review_flag
-- Description: Extend review_flag to include 'threat' classification
-- Date: 2025-12-21

-- Add enum value if missing.
DO $$
BEGIN
  IF NOT EXISTS (
    SELECT 1
    FROM pg_enum e
    JOIN pg_type t ON t.oid = e.enumtypid
    WHERE t.typname = 'review_flag'
      AND e.enumlabel = 'threat'
  ) THEN
    ALTER TYPE review_flag ADD VALUE 'threat';
  END IF;
END $$;

COMMENT ON TYPE review_flag IS 'Review classification: green/red/threat';


