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
Do not create duplicate CREATE TYPE migration query when same 'enumName's are exists #7523
Comments
This bug was fixed in #7419 and released in |
I updated typeorm to 0.2.32 but the issue seems to be still exists. |
ok, I'll add a test for this case |
Store built enum names in map class property Closes: typeorm#7523
Store built enum names in map class property Closes: typeorm#7523
I am seeing this same issue and it results in failures when |
what about the open pull request.... are there some concerns? |
I have same issue too, any update on this guys ? |
Same issue here too, it create n times the enum type the first time. If you edit the migration file and run the migration the next generate doesn't recreate enum type. |
Having the same issue here, using typeorm 0.3.11. |
Feature Description
The Problem
When there's a parent entity class with enum field that has multiple children, typeorm migration creates duplicate
CREATE TYPE
query in migration file. This causesType already defined
error when running migration.For example,
Then generate migration,
The Solution
Storing
enumName
in set or map to prevent from generating duplicate query might solve the issue.Considered Alternatives
For now, as of my knowledge, removing duplicate queries manually is the only way to solve the issue.
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: