-- Update permissions to reference resource IDs instead of ui_modals IDs
UPDATE permissions p
SET resource_id = r.id
FROM ui_modals m
JOIN resources r ON r.name = m.name
WHERE p.resource_id = m.id;
