-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Description
Issue type:
[x] question
[ ] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[x] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)
I'm thinking to migrate my application from Sequelize to TypeORM, as a first step I've tried to reimplement current Sequelize models to TypeORM.
I've encountered an issue that Sequelize and TypeORM generate postgres' enum type names differrently: Sequelize uses pattern 'enum_${tableName}_${columnName}' whereas TypeORM uses '${tableName}_${columnName}_enum'.toLowerCase(). Is there a way I can specify custom type name in TypeORM's model definition?
If not, would it be useful to be able to specify type name in column definition? Something like
@Column({
type: 'enum',
typeName: 'my_enum',
enum: MyEnum,
})
enum_column: MyEnum
This would also allow to reuse same postgres enum type across multiple columns.