medusa icon indicating copy to clipboard operation
medusa copied to clipboard

Generate Migration TypeORM

Open juanzgc opened this issue 3 years ago • 5 comments

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: https://github.com/adrien2p/medusa-extender/issues/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: https://github.com/adrien2p/medusa-extender/issues/113

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

juanzgc avatar Aug 17 '22 03:08 juanzgc

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.

olivermrbl avatar Aug 17 '22 05:08 olivermrbl

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

adrien2p avatar Aug 17 '22 08:08 adrien2p

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 avatar Aug 17 '22 08:08 adrien2p

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

adrien2p avatar Aug 19 '22 16:08 adrien2p

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

juanzgc avatar Aug 27 '22 05:08 juanzgc