Skip to content

Seed system roles on org creation and backfill orgs created since May 2026 #1061

Description

@julietshen

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

reliabilityRelated to keeping Coop working reliably for adopters

Type

Fields

Priority

None yet

Projects

  • Status
    In Progress
  • Status
    In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions