UPDATE products
SET hero_media_id = (
    SELECT id FROM media WHERE title = 'developpement02' AND deleted_at IS NULL ORDER BY id DESC LIMIT 1
)
WHERE slug = 'win-wms'
  AND deleted_at IS NULL
  AND (
      hero_media_id IS NULL
      OR hero_media_id = 0
  );

UPDATE pages
SET hero_media_id = (
    SELECT id FROM media WHERE title = 'developpement01' AND deleted_at IS NULL ORDER BY id DESC LIMIT 1
)
WHERE slug = 'solutions'
  AND deleted_at IS NULL;

UPDATE pages
SET hero_media_id = (
    SELECT id FROM media WHERE title = 'cfi01' AND deleted_at IS NULL ORDER BY id DESC LIMIT 1
)
WHERE slug = 'contact'
  AND deleted_at IS NULL
  AND (hero_media_id IS NULL OR hero_media_id = 0);

UPDATE pages
SET hero_media_id = (
    SELECT id FROM media WHERE title = 'developpement02' AND deleted_at IS NULL ORDER BY id DESC LIMIT 1
)
WHERE slug = 'demande-de-demonstration'
  AND deleted_at IS NULL
  AND (hero_media_id IS NULL OR hero_media_id = 0);
