@mikro-orm/knex 6.4.12-dev.2 → 6.4.12-dev.21

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.
@@ -791,13 +791,15 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
791
791
  const targetSchema = this.getSchemaName(prop.targetMeta, options) ?? this.platform.getDefaultSchemaName();
792
792
  qb.innerJoin(pivotProp1.name, targetAlias, {}, targetSchema);
793
793
  const targetFields = this.buildFields(prop.targetMeta, (options.populate ?? []), [], qb, targetAlias, options);
794
+ const additionalFields = [];
794
795
  for (const field of targetFields) {
795
796
  const f = field.toString();
796
- fields.unshift(f.includes('.') ? field : `${targetAlias}.${f}`);
797
+ additionalFields.push(f.includes('.') ? field : `${targetAlias}.${f}`);
797
798
  if (core_1.RawQueryFragment.isKnownFragment(field)) {
798
799
  qb.rawFragments.add(f);
799
800
  }
800
801
  }
802
+ fields.unshift(...additionalFields);
801
803
  // we need to handle 1:1 owner auto-joins explicitly, as the QB type is the pivot table, not the target
802
804
  populate.forEach(hint => {
803
805
  const alias = qb.getNextAlias(prop.targetMeta.tableName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.4.12-dev.2",
3
+ "version": "6.4.12-dev.21",
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.4.11"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.4.12-dev.2",
69
+ "@mikro-orm/core": "6.4.12-dev.21",
70
70
  "better-sqlite3": "*",
71
71
  "libsql": "*",
72
72
  "mariadb": "*"
@@ -97,6 +97,9 @@ class DatabaseTable {
97
97
  ignoreSchemaChanges: prop.ignoreSchemaChanges,
98
98
  };
99
99
  this.columns[field].unsigned ??= this.columns[field].autoincrement;
100
+ if (this.nativeEnums[type]) {
101
+ this.columns[field].enumItems ??= this.nativeEnums[type].items;
102
+ }
100
103
  const defaultValue = this.platform.getSchemaHelper().normalizeDefaultValue(prop.defaultRaw, prop.length);
101
104
  this.columns[field].default = defaultValue;
102
105
  });