@mikro-orm/knex 6.0.0-dev.82 → 6.0.0-dev.83

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.0.0-dev.82",
3
+ "version": "6.0.0-dev.83",
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,6 +66,6 @@
66
66
  "@mikro-orm/core": "^5.7.10"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "~6.0.0-dev.82"
69
+ "@mikro-orm/core": "~6.0.0-dev.83"
70
70
  }
71
71
  }
@@ -155,6 +155,7 @@ class QueryBuilderHelper {
155
155
  const prop2 = pivotMeta.relations[0] === prop ? pivotMeta.relations[1] : pivotMeta.relations[0];
156
156
  return {
157
157
  prop, type, cond, ownerAlias, alias,
158
+ inverseAlias: ownerAlias,
158
159
  table: pivotMeta.collection,
159
160
  schema: pivotMeta.schema,
160
161
  joinColumns: prop.joinColumns,
@@ -179,7 +180,7 @@ class QueryBuilderHelper {
179
180
  });
180
181
  if (join.prop.targetMeta.discriminatorValue && !join.path?.endsWith('[pivot]')) {
181
182
  const typeProperty = join.prop.targetMeta.root.discriminatorColumn;
182
- const alias = !join.prop.owner ? join.inverseAlias ?? join.alias : join.ownerAlias;
183
+ const alias = join.inverseAlias ?? join.alias;
183
184
  join.cond[`${alias}.${typeProperty}`] = join.prop.targetMeta.discriminatorValue;
184
185
  }
185
186
  Object.keys(join.cond).forEach(key => {