Skip to content

Conversation

@SimonLoir
Copy link
Contributor

@SimonLoir SimonLoir commented Dec 11, 2025

  • Updated apps/web/package.json version to 0.11.6.
  • Modified Prisma schema to enable support for multiple registries per organization.
  • Added migration to drop registryId column, create a join table, and update relationships.

Summary by CodeRabbit

  • New Features

    • Organizations can now be associated with multiple registries, enabling greater flexibility in managing registry configurations and resources.
  • Chores

    • Version bumped to 0.11.6.

✏️ Tip: You can customize this high-level summary in your review settings.

…registry support

- Updated `apps/web/package.json` version to `0.11.6`.
- Modified Prisma schema to enable support for multiple registries per organization.
- Added migration to drop `registryId` column, create a join table, and update relationships.
Copilot AI review requested due to automatic review settings December 11, 2025 13:03
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 11, 2025

Walkthrough

This PR converts the Organization-Registry relationship from one-to-one optional to many-to-many by introducing a join table in the database migration and updating the Prisma schema. The web package version is also bumped to 0.11.6.

Changes

Cohort / File(s) Summary
Version bump
apps/web/package.json
Updated package version from 0.11.5 to 0.11.6
Database schema migration
packages/db/prisma/migrations/20251211125015_allow_multiple_registries_on_organization/migration.sql
Removed direct registryId foreign key from organization table; created _OrganizationToRegistry join table with composite primary key and cascading foreign key constraints
Prisma schema update
packages/db/prisma/schema.prisma
Updated Organization.registries field from one-to-one optional relation (registries?: Registry? with registryId?: String?) to many-to-many array relation (registries: Registry[])

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify that the migration correctly handles data migration strategy (warning note indicates potential data loss when dropping registryId)
  • Confirm Prisma schema syntax is correct for the many-to-many implicit relation
  • Validate that foreign key constraints with ON DELETE CASCADE and ON UPDATE CASCADE match the desired behavior
  • Check that the join table naming and structure align with Prisma conventions

Possibly related PRs

Poem

🐰 Hops with glee, a registry dance so grand,
One-to-one becomes many, across the land,
A join table blooms, so bright and new,
Multiple registries, an org's dream come true!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main change: converting the organization-registry relationship from one-to-one to many-to-many, enabling multiple registries per organization.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/multiple-registries

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 926c151 and 912bc24.

📒 Files selected for processing (3)
  • apps/web/package.json (1 hunks)
  • packages/db/prisma/migrations/20251211125015_allow_multiple_registries_on_organization/migration.sql (1 hunks)
  • packages/db/prisma/schema.prisma (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Agent
🔇 Additional comments (2)
apps/web/package.json (1)

3-3: Version bump is appropriate for this database migration.

A patch version increment signals to operators that a database migration is required when deploying this version. This is the correct versioning practice.

packages/db/prisma/schema.prisma (1)

132-132: Schema relationship change is correctly defined.

The conversion to a many-to-many implicit relation is properly implemented. The columns in the join table follow Prisma's requirement where A points to Organization (alphabetically first) and B points to Registry, and the inverse organizations relation on the Registry model completes the bidirectional relationship.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables organizations to associate with multiple registries instead of being limited to a single registry. The change modifies the database schema from a one-to-one relationship to a many-to-many relationship between Organization and Registry models, using Prisma's implicit join table pattern.

Key Changes:

  • Updated Organization-Registry relationship from one-to-one to many-to-many in the Prisma schema
  • Added database migration to drop the registryId column and create the _OrganizationToRegistry join table
  • Bumped web application version to 0.11.6

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/db/prisma/schema.prisma Changed Organization model's registries field from optional singular Registry reference to plural Registry array, enabling many-to-many relationship
packages/db/prisma/migrations/20251211125015_allow_multiple_registries_on_organization/migration.sql Added migration to drop foreign key constraint, remove registryId column, and create implicit join table with proper indexes and constraints
apps/web/package.json Bumped version from 0.11.5 to 0.11.6

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SimonLoir SimonLoir merged commit 7fd90b5 into main Dec 11, 2025
10 checks passed
@SimonLoir SimonLoir deleted the fix/multiple-registries branch December 11, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants