-- Stop using frontend-bundled images as operational product assets.
-- Operators should upload real covers through /api/*/uploads/raw so records point to /api/files/:id.
update agent_product_details
set cover_url = '',
    updated_at = now()
where cover_url like '/assets/%';

update course_product_details
set cover_url = '',
    updated_at = now()
where cover_url like '/assets/%';

update event_product_details
set cover_url = '',
    updated_at = now()
where cover_url like '/assets/%';

update data_product_details
set cover_url = '',
    file_url = case when file_url like '/assets/%' then '' else file_url end,
    updated_at = now()
where cover_url like '/assets/%'
   or file_url like '/assets/%';

update news_articles
set cover_url = '',
    updated_at = now()
where cover_url like '/assets/%';

update site_home_slides
set image_url = '',
    updated_at = now()
where image_url like '/assets/%';

update site_login_slides
set image_url = '',
    updated_at = now()
where image_url like '/assets/%';

update site_home_assets
set image_url = '',
    updated_at = now()
where image_url like '/assets/%';

update site_page_block_items
set image_url = '',
    updated_at = now()
where image_url like '/assets/%';
