The seed migration file inserts the 7 system roles for every org that existed the moment the migration ran, but for any orgs created afterward the roles do not get created. This should probably be part of the create-org-and-user.ts bootstrap file and a backfill migration for any orgs created since May 2026.
(I wrote this I am a human!)
Context: because of this, newer orgs have zero public.roles rows and their users have role_id = NULL. Today this is masked by fallbacks (static role defaults, static permission map, and lazy materialization on first role edit), so permissions still work. But it means role rows and users.role_id are unreliable, which blocks referencing roles by role_id (e.g. queue access by role, Groups, deletable custom roles).
(Claude wrote this)
🤖 Generated with Claude Code
The seed migration file inserts the 7 system roles for every org that existed the moment the migration ran, but for any orgs created afterward the roles do not get created. This should probably be part of the
create-org-and-user.tsbootstrap file and a backfill migration for any orgs created since May 2026.(I wrote this I am a human!)
Context: because of this, newer orgs have zero
public.rolesrows and their users haverole_id = NULL. Today this is masked by fallbacks (static role defaults, static permission map, and lazy materialization on first role edit), so permissions still work. But it means role rows andusers.role_idare unreliable, which blocks referencing roles byrole_id(e.g. queue access by role, Groups, deletable custom roles).(Claude wrote this)
🤖 Generated with Claude Code