You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am rebasing my typeorm fork from v0.2.31 to latest master (~v0.2.37) and trying to use it in our project.
One of the issues I have is that after upgrade, generating migrations over an up-to-date existing database a rather high amount of unnecessary changes. One of the issues I could pinpoint is that all enum columns generate ALTER TABLE statements.
The column enum property is documented to have all the enum values, and indeed when debugging both old and new column definitions have enum = array of enum (string) values. So we're comparing array references there. This code is broken for quite a while, I suspect the issue appeared due to some object cloning which made the array references be different.
Expected Behavior
No migrations generated
Actual Behavior
Unnecessary ALTER TABLE ... CHANGE column is generated.
Applying the migration does not solve the problem, generating a new migration afterwards keeps generating the same script.
Issue Description
I am rebasing my typeorm fork from v0.2.31 to latest master (~v0.2.37) and trying to use it in our project.
One of the issues I have is that after upgrade, generating migrations over an up-to-date existing database a rather high amount of unnecessary changes. One of the issues I could pinpoint is that all enum columns generate ALTER TABLE statements.
I believe the issue is in BaseQueryRunner here:
typeorm/src/query-runner/BaseQueryRunner.ts
Line 343 in a868078
The column enum property is documented to have all the enum values, and indeed when debugging both old and new column definitions have enum = array of enum (string) values. So we're comparing array references there. This code is broken for quite a while, I suspect the issue appeared due to some object cloning which made the array references be different.
Expected Behavior
No migrations generated
Actual Behavior
Unnecessary ALTER TABLE ... CHANGE column is generated.
Applying the migration does not solve the problem, generating a new migration afterwards keeps generating the same script.
Steps to Reproduce
Here's an example entity:
Generating migrations produces the following:
My Environment
Additional Context
Relevant Database Driver(s)
aurora-data-api
aurora-data-api-pg
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
sqlite
sqlite-abstract
sqljs
sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: