-- Migration 048 — UfiSpace and Brocade product images (direct URL injection)
--
-- UfiSpace: images served from ufispace.com/image/<hash>/<filename>
--   No og:image meta tags — images extracted from product page carousels.
--   All URLs verified HTTP 200 (2026-04-21).
--
-- Brocade G720/G730: og:image from broadcom.com (acquired Brocade FC networking).
--   ICX 7850-48FS: acquired by CommScope/Ruckus — image URL has rotating session
--   token, not stable; skipped.

-- ── UfiSpace ─────────────────────────────────────────────────────────────────

UPDATE switches
SET image_url        = 'https://www.ufispace.com/image/5R/9510-28DC-front-2026.png',
    assets_scraped_at = NOW()
WHERE model = 'S9510-28DC'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'ufispace');

UPDATE switches
SET image_url        = 'https://www.ufispace.com/image/2n/3475633079f4f0df148772926dd278c9.png',
    assets_scraped_at = NOW()
WHERE model = 'S9600-30DX'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'ufispace');

UPDATE switches
SET image_url        = 'https://www.ufispace.com/image/24/5dd78db3fb82420f59d164e35131b476.png',
    assets_scraped_at = NOW()
WHERE model = 'S9600-32X'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'ufispace');

UPDATE switches
SET image_url        = 'https://www.ufispace.com/image/2D/9b12bdf9033020045872a3e55132d7b9.png',
    assets_scraped_at = NOW()
WHERE model = 'S9600-72XC'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'ufispace');

UPDATE switches
SET image_url        = 'https://www.ufispace.com/image/x/f0edea5710efc9ce351b742b222f03d1.png',
    assets_scraped_at = NOW()
WHERE model = 'S9700-53DX'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'ufispace');

UPDATE switches
SET image_url        = 'https://www.ufispace.com/image/2V/aa3e530e3555baacedbc6e603c1fc331.png',
    assets_scraped_at = NOW()
WHERE model = 'S9710-76D'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'ufispace');

-- ── Brocade (via Broadcom) ────────────────────────────────────────────────────

UPDATE switches
SET image_url        = 'https://www.broadcom.com/media/blt4ac44e0e6c6d8341/bltf8d09763812cf984/604f5eb61078bc20548c0494/g720-right_283_29.jpeg',
    product_page_url = COALESCE(product_page_url, 'https://www.broadcom.com/products/fibre-channel-networking/switches/g720-switch'),
    assets_scraped_at = NOW()
WHERE model = 'G720'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'brocade');

UPDATE switches
SET image_url        = 'https://www.broadcom.com/media/blt4ac44e0e6c6d8341/blt1d11847b97f678d0/62030d79d6534f0c057188c3/Brocade_G730_Left.jpeg',
    product_page_url = COALESCE(product_page_url, 'https://www.broadcom.com/products/fibre-channel-networking/switches/g730-switch'),
    assets_scraped_at = NOW()
WHERE model = 'G730'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'brocade');

-- ICX 7850-48FS: now CommScope/Ruckus — image URL uses rotating session token,
-- not stable enough to store. Left as NULL pending a stable image source.
