@mikro-orm/knex 6.5.10-dev.17 → 6.5.10-dev.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/schema/DatabaseTable.js +7 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/knex",
|
|
3
|
-
"version": "6.5.10-dev.
|
|
3
|
+
"version": "6.5.10-dev.19",
|
|
4
4
|
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@mikro-orm/core": "^6.5.9"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "6.5.10-dev.
|
|
69
|
+
"@mikro-orm/core": "6.5.10-dev.19",
|
|
70
70
|
"better-sqlite3": "*",
|
|
71
71
|
"libsql": "*",
|
|
72
72
|
"mariadb": "*"
|
package/schema/DatabaseTable.js
CHANGED
|
@@ -675,10 +675,15 @@ class DatabaseTable {
|
|
|
675
675
|
if (fk) {
|
|
676
676
|
return this.getPropertyTypeForForeignKey(namingStrategy, fk);
|
|
677
677
|
}
|
|
678
|
+
const enumMode = this.platform.getConfig().get('entityGenerator').enumMode;
|
|
678
679
|
// If this column is using an enum.
|
|
679
680
|
if (column.enumItems?.length) {
|
|
680
|
-
|
|
681
|
-
|
|
681
|
+
if (enumMode === 'ts-enum') {
|
|
682
|
+
// We will create a new enum name for this type and set it as the property type as well.
|
|
683
|
+
return namingStrategy.getEnumClassName(column.name, this.name, this.schema);
|
|
684
|
+
}
|
|
685
|
+
// With other enum strategies, we need to use the type name.
|
|
686
|
+
return namingStrategy.getEnumTypeName(column.name, this.name, this.schema);
|
|
682
687
|
}
|
|
683
688
|
return column.mappedType?.runtimeType ?? 'unknown';
|
|
684
689
|
}
|