@mikro-orm/core 6.6.18-dev.3 → 6.6.18-dev.4

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/core",
3
- "version": "6.6.18-dev.3",
3
+ "version": "6.6.18-dev.4",
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",
@@ -64,7 +64,7 @@
64
64
  "esprima": "4.0.1",
65
65
  "fs-extra": "11.3.3",
66
66
  "globby": "11.1.0",
67
- "mikro-orm": "6.6.18-dev.3",
67
+ "mikro-orm": "6.6.18-dev.4",
68
68
  "reflect-metadata": "0.2.2"
69
69
  }
70
70
  }
@@ -397,6 +397,10 @@ class UnitOfWork {
397
397
  if (prop.formula) {
398
398
  delete referrer[prop.name];
399
399
  }
400
+ else if (prop.primary) {
401
+ // the referrer's primary key contains the removed entity, so its identity cannot survive the removal
402
+ this.unsetIdentity(referrer);
403
+ }
400
404
  else {
401
405
  delete (0, entity_1.helper)(referrer).__data[prop.name];
402
406
  }
@@ -196,7 +196,8 @@ class DataloaderUtils {
196
196
  const prop = group[0][0].property;
197
197
  const options = {};
198
198
  const wrap = (cond) => ({ [prop.name]: cond });
199
- const orderBy = Utils_1.Utils.asArray(group[0][1]?.orderBy).map(o => wrap(o));
199
+ // `findChildrenFromPivotTable` expects the `orderBy` relative to the target entity, so no wrapping here
200
+ const orderBy = Utils_1.Utils.asArray(group[0][1]?.orderBy);
200
201
  const populate = wrap(group[0][1]?.populate);
201
202
  const owners = group.map(c => c[0].owner);
202
203
  const $or = [];