@mikro-orm/knex 6.5.10-dev.18 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.5.10-dev.18",
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.18",
69
+ "@mikro-orm/core": "6.5.10-dev.19",
70
70
  "better-sqlite3": "*",
71
71
  "libsql": "*",
72
72
  "mariadb": "*"
@@ -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
- // We will create a new enum name for this type and set it as the property type as well.
681
- return namingStrategy.getEnumClassName(column.name, this.name, this.schema);
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
  }