Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate Migration TypeORM #2054

Closed
juanzgc opened this issue Aug 17, 2022 · 5 comments
Closed

Generate Migration TypeORM #2054

juanzgc opened this issue Aug 17, 2022 · 5 comments

Comments

@juanzgc
Copy link
Contributor

juanzgc commented Aug 17, 2022

Bug report

Describe the bug

Generating a migration with medusa-extender does not take into account the extended Entities due to a possible issue with Typeorm drivers.

System information

Medusa version (including plugins): 1.3.5
Node.js version: v16.13.0
Database: PostgreSQL
Operating system: MacOS
Browser (if relevant):

Steps to reproduce the behavior

All reproducible steps are below:
adrien2p/medusa-extender#113

Expected behavior

Extended entities should still allow for generated migrations with Typeorm. The ask is to migrate TypeORM from v2 to v3 in order to eventually attempt to find a solution.

Additional context

Most of the context is in an issue within medusa-extender: adrien2p/medusa-extender#113

The main goal of this issue to bring to attention the possible need for migrating TypeORM 😇

@olivermrbl
Copy link
Contributor

Thanks for reporting this one in @juanzgc! We started looking into upgrading Typeorm last week, so hopefully, we'll be able to make it happen in the near future.

@adrien2p
Copy link
Member

@olivermrbl i ve started my DD about it, hopefully it could be possible in few weeks 👍

@adrien2p
Copy link
Member

But even without specifying extended entities but just the medusa one, the output is the same with the same weird queries.

The problem comes from the postgres driver called by the rdbms. When executing the actions in order, for each of them there is a check to know if something changed of not. The result of that check does not make sense and it is a known issue.
Let hope that the latests version bring improvements on that part

@adrien2p
Copy link
Member

A solution has been provided in the extender repo, could I get you to give it a try please?

@juanzgc
Copy link
Contributor Author

juanzgc commented Aug 27, 2022

Unfortunately, that solution doesn't seem to work :(

@srindom srindom closed this as completed Dec 12, 2022
VenusPR added a commit to VenusPR/Shopify_Richard that referenced this issue Mar 9, 2023
This PR references medusajs/medusa#2294 so all credit to Adrien.

Unfortunately, migrating Typeorm becomes very difficult as new code continues to be committed. Therefore, I created this PR which **only** focuses on the migration. This PR limits the amount of code changes
in the Service and Repository repos to prevent **as many** painful merge conflicts.

I believe with this PR we can actually move forward with migrating to Typeorm V3.

The overall goal is to eventually fix: medusajs/medusa#2054 which I believe will improve Developer Experience when using the medusa-extender.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants