-- EasyAI/server-main is intentionally not migrated as an AI Gateway runtime
-- provider. Keep its historical catalog rows for traceability, but hide them
-- from fresh admin selection and mark the exclusion reason explicitly.
UPDATE base_model_catalog
SET status = 'deprecated',
    metadata = COALESCE(metadata, '{}'::jsonb) || jsonb_build_object(
      'selectable', false,
      'migrationExcludedReason', 'excluded from AI Gateway media runtime migration to avoid gateway-to-server-main loopback',
      'migrationExcludedAt', '0039_exclude_easyai_media_catalog'
    )
WHERE provider_key = 'easyai'
  AND model_type ?| ARRAY[
    'image_generate',
    'image_edit',
    'video_generate',
    'image_to_video',
    'omni_video',
    'video_edit'
  ];
