Closed darara47 closed 1 month ago
Hey @darara47,
We had a regression in one of our releases, which has already been fixed, can you upgrade to the latest preview version, run npx medusa migrations run && npx medusa links sync
and try again?
I had similar issue and npx medusa links sync helped me, thanks a lot!
Hey @darara47,
We had a regression in one of our releases, which has already been fixed, can you upgrade to the latest preview version, run
npx medusa migrations run && npx medusa links sync
and try again?
Glad to hear that! 🎉
Bug report
Describe the bug
When running a query that links the CustomerModule and BadgeModule in a custom Medusa module, an error occurs. The system generates a SQL query that targets a non-existent table due to incorrect capitalization in the table name. Specifically, it attempts to query "customer_customer_badgesmodule_badge", but the correct table is "customer_customer_badgesModule_badge" (note the capitalization of badgesModule).
System information
Medusa version (including plugins): 1.20.6-preview-20240917110030 Node.js version: v20.11.1 Database: PostgreSQL 15.2 Operating system: MacOS Sonoma Browser (if relevant):
Steps to reproduce the behavior
Expected behavior
The query should execute and return the requested data, including the linked model (badge with associated customers).
Screenshots
Additional context
The issue appears to stem from the query generated by the system:
The query is targeting the table "customer_customer_badgesmodule_badge", which does not exist. The correct table name should be "customer_customer_badgesModule_badge" (note the capitalization of badgesModule).
Changing the table name manually using pgAdmin to "customer_customer_badgesmodule_badge" resolves the issue and the query returns the correct data.