Open Goldziher opened 3 years ago
This was fixed at one point but seems to have regressed: https://github.com/typeorm/typeorm/issues/7647
Happens for me as well, although I have the exact same enumName
in two different entities:
@Column({
name: "apps_visibility",
nullable: true,
type: "enum",
enum: AppsVisibility,
enumName: 'AppsVisibilityEnum',
array: true,
default: [AppsVisibility.ONBOARDING],
})
@Field()
appsVisibility: AppsVisibility[];
same issue for me
Just face the same issue!
I had the same problem. When generating a migration, TypeORM creates the same Enum several times under different names. As a result, an error occurs when performing the migration, because The data types of related columns in different tables are not the same (Enums have different names).
Issue Description
When using the
enumName
parameter to define global enums, TypeORM creates multiple instances of the global enum, causing errors.Expected Behavior
Only a single global enum is created per type, if the enumName property is the same
Actual Behavior
This is copied from the migration generated, i ordered it alphabetically so its clearer:
Steps to Reproduce
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?