-- Migration 043 — Clear generic / logo images from switches
-- Removes image_url entries that are clearly logos or marketing photos,
-- not actual product hardware images. The scraper will re-fetch with the
-- improved isGenericImage() filter on the next daily run.

UPDATE switches
SET image_url = NULL, assets_scraped_at = NULL
WHERE image_url IS NOT NULL
  AND (
    -- Generic logos (Cisco, vendor brand marks)
    image_url ILIKE '%logo%'
    OR image_url ILIKE '%.svg'
    -- Alcatel-Lucent Enterprise lifestyle / naas hero images
    OR image_url ILIKE '%naas-homepag%'
    OR image_url ILIKE '%al-enterprise%naas%'
    -- Generic OG defaults
    OR image_url ILIKE '%og-default%'
    OR image_url ILIKE '%default-social%'
    OR image_url ILIKE '%og_default%'
    -- Placeholder/fallback images
    OR image_url ILIKE '%placeholder%'
    OR image_url ILIKE '%no-image%'
    OR image_url ILIKE '%noimage%'
    -- Generic homepage images
    OR image_url ILIKE '%/homepage/%'
    -- Lifestyle / stock photos (common CDN path patterns)
    OR image_url ILIKE '%lifestyle%'
    OR image_url ILIKE '%stock-photo%'
  );
