-
-
Save rightfold/e37f5bf7e38cad4e996d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT p.id, p.name, array_to_json(array_agg(gp.group_id)) AS group_ids | |
FROM permissions AS p | |
LEFT JOIN group_permissions AS gp | |
ON gp.permission_id = p.id | |
GROUP BY p.id | |
ORDER BY p.name ASC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment