UPDATE platform_models m
SET rate_limit_policy = '{}'::jsonb,
    updated_at = now()
FROM base_model_catalog b,
     model_runtime_policy_sets rp
WHERE m.base_model_id = b.id
  AND m.runtime_policy_set_id = rp.id
  AND m.runtime_policy_set_id IS NOT NULL
  AND m.runtime_policy_set_id IS DISTINCT FROM b.runtime_policy_set_id
  AND m.rate_limit_policy = b.default_rate_limit_policy
  AND rp.rate_limit_policy <> '{}'::jsonb;
