-- =============================================================================
-- larcare_years_experience.sql - the home page stat "Years Combined Experience" reads 150+ (it read 100+), matching
-- the Meet Our Team page. Changes the saved stat only while it still says 100+, so a number edited afterwards in
-- ABOS > Website > Collections is never overwritten. Safe to run again.
-- Requires seed_larcare_dynamic_design.sql first.
-- =============================================================================
SET @site_id := (SELECT id FROM dim_web_sites WHERE public_site_key = 'pSlfeq9OCm5MvZyoFguIK7jy0uz2aKShJkxZxTSWXwzPOpYJ' AND is_deleted = 0 LIMIT 1);
SET @c_stats := (SELECT id FROM dim_web_collections WHERE site_id = @site_id AND collection_key = 'site-stats' LIMIT 1);

UPDATE fact_web_entries SET data_json = JSON_SET(data_json, '$.value', '150+')
WHERE site_id = @site_id AND collection_id = @c_stats AND slug = 'years-experience' AND is_deleted = 0 AND JSON_VALID(data_json)
  AND JSON_UNQUOTE(JSON_EXTRACT(data_json, '$.value')) = '100+';
