Closed xkisu closed 2 months ago
Thanks for reporting this @xkisu , I believe this is a bug that should be handled by the command rather than something added to the doc. I'll close this issue here, but can you open it in the main medusajs monorepo? thanks again!
Thanks for reporting this @xkisu , I believe this is a bug that should be handled by the command rather than something added to the doc. I'll close this issue here, but can you open it in the main medusajs monorepo? thanks again!
Sure thing!
Wasn't sure if I should file this in the core medusa repository or this one - I'm happy to make a new issue in the core if needed :)
I've been testing the v2 preview for a project, using a modified version of the digital product example. My only modifications where changing the "digital" name/identifier to a platform-specific name ("cloudprinter") for my own extension (i.e. "digitalProduct" -> "cloudprinterProduct").
The lengthening of the name causes issues with module linking, due to the database names generated by
db:sync-links
being longer than the 63 character limit imposed by Postgres. The truncated names start to collide, and make syncing the module links fail.Error from
npx medusa db:sync-links
:I ran the provided SQL manually with extra debugging, and the issue became apparent:
Postgres is truncating both of these identifiers create by
db:sync-links
to 63 characters:cloudprinterProductModule_cloudprinter_product_order_order_order
cloudprinterProductModule_cloudprinter_product_order_order_order_pkey
Which causes them both to be changed to
cloudprinterProductModule_cloudprinter_product_order_order_orde
, which then causes them to conflict with each other and fail the transition.For now, I've used the link options to shorten the identifiers:
I figured this might be something that the docs and the
db:sync-links
command might want to warn about, since the 63 character hard limit is enforced by Postegres (and can't be changed without compiling a custom version of Postgres).