Skip to content

Commit

Permalink
Sort roles by created date.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Oct 13, 2024
1 parent d52eac0 commit 17b5cc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ listPerms AS (
WHERE ur.parent_id IS NOT NULL GROUP BY ur.parent_id
)
SELECT p.*, COALESCE(l.listPerms, '[]'::JSONB) AS "list_permissions" FROM mainroles p
LEFT JOIN listPerms l ON p.id = l.parent_id;
LEFT JOIN listPerms l ON p.id = l.parent_id ORDER BY p.created_at;

-- name: create-role
INSERT INTO user_roles (name, permissions, created_at, updated_at) VALUES($1, $2, NOW(), NOW()) RETURNING *;
Expand Down

0 comments on commit 17b5cc1

Please sign in to comment.