-- Migration 045 — Edgecore product images (direct URL injection)
--
-- Edgecore blocks headless browsers (Playwright gets 403) but serves og:image
-- from their WooCommerce site via plain HTTP.  The AS7xxx enterprise switches
-- (7535, 7726, 7946, 9516) are not listed on edge-core.com at all.
--
-- Source: og:image extracted with curl from each /product/<slug>/ page.
-- Images verified as actual product photos (not logos / generic).

UPDATE switches
SET image_url        = 'https://www.edge-core.com/wp-content/uploads/2023/08/DCS204-A.png',
    product_page_url = COALESCE(product_page_url, 'https://www.edge-core.com/product/dcs204/'),
    assets_scraped_at = NOW()
WHERE model = 'DCS204'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'edgecore');

UPDATE switches
SET image_url        = 'https://www.edge-core.com/wp-content/uploads/2023/08/DCS510-A.png',
    product_page_url = COALESCE(product_page_url, 'https://www.edge-core.com/product/dcs510/'),
    assets_scraped_at = NOW()
WHERE model = 'DCS510'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'edgecore');

UPDATE switches
SET image_url        = 'https://www.edge-core.com/wp-content/uploads/2023/08/dcs810-A.png',
    product_page_url = COALESCE(product_page_url, 'https://www.edge-core.com/product/dcs810/'),
    assets_scraped_at = NOW()
WHERE model = 'DCS810'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'edgecore');

UPDATE switches
SET image_url        = 'https://www.edge-core.com/wp-content/uploads/2023/08/EPS203-A.png',
    product_page_url = COALESCE(product_page_url, 'https://www.edge-core.com/product/eps203/'),
    assets_scraped_at = NOW()
WHERE model = 'EPS203'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'edgecore');

UPDATE switches
SET image_url        = 'https://www.edge-core.com/wp-content/uploads/2023/08/AS8000-A.png',
    product_page_url = COALESCE(product_page_url, 'https://www.edge-core.com/product/minipack-as8000-open-modular-platform/'),
    assets_scraped_at = NOW()
WHERE model = 'Minipack2'
  AND vendor_id = (SELECT id FROM vendors WHERE slug = 'edgecore');
