fix(memberships): collapse existing and prevent duplicate memberships#5740
fix(memberships): collapse existing and prevent duplicate memberships#5740scott-ray-wilson merged 3 commits intomainfrom
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Greptile SummaryThis PR introduces a data migration that collapses pre-existing duplicate The migration is well-structured and previously raised concerns (idempotent Confidence Score: 3/5
Important Files Changed
Last reviewed commit: 42e9bfa |
backend/src/db/migrations/20260317200000_membership-unique-constraints.ts
Show resolved
Hide resolved
backend/src/db/migrations/20260317200000_membership-unique-constraints.ts
Show resolved
Hide resolved
backend/src/db/migrations/20260317200000_membership-unique-constraints.ts
Outdated
Show resolved
Hide resolved
|
@greptile can you re-review the latest changes addressing your comments |
Context
This PR adds a migration to collapse all existing duplicate memberships at each scope and add a single membership exclusivity constraint on projects and orgs
Duplicate project memberships will have their roles collapsed, while org membership roles will preserve the earliest membership role
Screenshots
N/A
Steps to verify the change
PRIOR TO MIGRATION:
Type
Checklist
type(scope): short description(scope is optional, e.g.,fix: prevent crash on syncorfix(api): handle null response).