@mikro-orm/core 7.0.7-dev.18 → 7.0.7-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/entity/EntityHelper.js +12 -2
- package/package.json +1 -1
- package/utils/Utils.js +1 -1
package/entity/EntityHelper.js
CHANGED
|
@@ -223,10 +223,20 @@ export class EntityHelper {
|
|
|
223
223
|
if (entity && (!prop.owner || helper(entity).__initialized)) {
|
|
224
224
|
EntityHelper.propagateOneToOne(entity, owner, prop, prop2, value, old);
|
|
225
225
|
}
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
}
|
|
227
|
+
else if (old && old !== value) {
|
|
228
|
+
// Inverse already points to owner — propagation is not needed,
|
|
229
|
+
// but we still need to clean up old's inverse side.
|
|
230
|
+
helper(old).__pk ??= helper(old).getPrimaryKey();
|
|
231
|
+
if (old[prop2.name] != null) {
|
|
232
|
+
delete helper(old).__data[prop2.name];
|
|
233
|
+
old[prop2.name] = null;
|
|
228
234
|
}
|
|
229
235
|
}
|
|
236
|
+
if (old && old !== value && prop.orphanRemoval) {
|
|
237
|
+
helper(old).__pk ??= helper(old).getPrimaryKey();
|
|
238
|
+
helper(old).__em?.getUnitOfWork().scheduleOrphanRemoval(old);
|
|
239
|
+
}
|
|
230
240
|
}
|
|
231
241
|
}
|
|
232
242
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "7.0.7-dev.
|
|
3
|
+
"version": "7.0.7-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
|
"keywords": [
|
|
6
6
|
"data-mapper",
|
package/utils/Utils.js
CHANGED
|
@@ -132,7 +132,7 @@ export function parseJsonSafe(value) {
|
|
|
132
132
|
/** Collection of general-purpose utility methods used throughout the ORM. */
|
|
133
133
|
export class Utils {
|
|
134
134
|
static PK_SEPARATOR = '~~~';
|
|
135
|
-
static #ORM_VERSION = '7.0.7-dev.
|
|
135
|
+
static #ORM_VERSION = '7.0.7-dev.19';
|
|
136
136
|
/**
|
|
137
137
|
* Checks if the argument is instance of `Object`. Returns false for arrays.
|
|
138
138
|
*/
|