@mikro-orm/sql 7.1.5-dev.20 → 7.1.5-dev.22

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.
@@ -1248,6 +1248,11 @@ export class AbstractSqlDriver extends DatabaseDriver {
1248
1248
  if (owners.length === 0) {
1249
1249
  return {};
1250
1250
  }
1251
+ // The pivot order is recomputed via `getPivotOrderBy`, so the parent `populateOrderBy` must not leak
1252
+ // into the pivot subquery — its keys reference the parent entity, not the pivot (GH #7910).
1253
+ if (options?.populateOrderBy != null) {
1254
+ options = { ...options, populateOrderBy: undefined };
1255
+ }
1251
1256
  const pivotMeta = this.metadata.get(prop.pivotEntity);
1252
1257
  if (prop.discriminatorColumn && QueryHelper.isUnionTargetPolymorphic(prop)) {
1253
1258
  return this.loadFromUnionTargetPolymorphicPivotTable(prop, owners, where, orderBy, ctx, options, pivotJoin);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/sql",
3
- "version": "7.1.5-dev.20",
3
+ "version": "7.1.5-dev.22",
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
  "keywords": [
6
6
  "data-mapper",
@@ -53,7 +53,7 @@
53
53
  "@mikro-orm/core": "^7.1.4"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.1.5-dev.20"
56
+ "@mikro-orm/core": "7.1.5-dev.22"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"