USE lifanghe_education;

UPDATE roles
SET permissions = JSON_ARRAY_APPEND(permissions, '$', 'points:rule')
WHERE role IN ('campus_admin', 'finance')
  AND JSON_CONTAINS(permissions, JSON_QUOTE('points:rule')) = 0
  AND JSON_CONTAINS(permissions, JSON_QUOTE('*:*:*')) = 0;
