
## Add new index to was_user_latest_upgrade table ##
ALTER TABLE `was_user_latest_upgrade`
ADD INDEX `idx_insert_timestamp` (`insert_timestamp`);


## Set updated range values in was_user_trends_setting table ##
UPDATE was_user_trends_setting AS ts
SET ts.range = CASE 
    WHEN ts.range = 'custom_filter' THEN 'custom'
    WHEN ts.range = 'all' THEN 'all_time'
    WHEN ts.range = '24_month' THEN 'last_24_months'
    ELSE ts.range
END;
