feat(cli): add db:migrate command, patch link-modules, fix product models#862
Open
vholik wants to merge 3 commits into
Open
feat(cli): add db:migrate command, patch link-modules, fix product models#862vholik wants to merge 3 commits into
vholik wants to merge 3 commits into
Conversation
…t models - Add `mercurjs db:migrate` command that patches Medusa and runs migrations - Patch @medusajs/link-modules to strip product link definitions so Mercur's own product links take precedence - Fix manyToMany pivotTable duplication in product module models (product-variant, product-category, product-rejection-reason) - Remove baseRepository manual resolution from ProductModuleService - Remove old attribute API routes and workflows - Add product module migrations Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Follow the same resolution chain the runtime uses to find the correct @medusajs/link-modules copy in bun's cache, ensuring product link definitions are actually stripped from the copy that gets loaded. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ix M:N column order Remove the product-seller link (no longer needed). Register the mercur product module in withMercur so it overrides the default Medusa one, preventing ENTITIES cache collision with the original ProductCategory (which lacks the attributes relationship). Fix pivot table column ordering in product_category_attribute migration snapshot. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Si3r4dz
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mercurjs db:migratecommand that patches Medusa before runningmedusa db:migrate@medusajs/link-modulesto strip product link definitions (product-sales-channel, product-shipping-profile, product-variant-inventory-item, product-variant-price-set) so Mercur's own links take precedencepivotTableduplication on inverse sides of manyToMany relationships in product module models (product-variant, product-category, product-rejection-reason, product)baseRepositorymanual resolution fromProductModuleService(not a registered container key in MedusaJS v2)Test plan
mercurjs db:migrateand verify product link tables are not created by Medusa's built-in linkspivotTableduplication errors on startupProductModuleServiceinitializes withoutbaseRepositoryresolution error🤖 Generated with Claude Code