Created
August 7, 2020 10:18
-
-
Save yleflour/0bda286aef0b80c16000ae7c93107178 to your computer and use it in GitHub Desktop.
Fix for https://github.com/typeorm/typeorm/issues/3938 to be used with patch-package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/node_modules/typeorm/persistence/subject-builder/OneToManySubjectBuilder.js b/node_modules/typeorm/persistence/subject-builder/OneToManySubjectBuilder.js | |
index 43fb09e..b62e654 100644 | |
--- a/node_modules/typeorm/persistence/subject-builder/OneToManySubjectBuilder.js | |
+++ b/node_modules/typeorm/persistence/subject-builder/OneToManySubjectBuilder.js | |
@@ -145,10 +145,11 @@ var OneToManySubjectBuilder = /** @class */ (function () { | |
parentSubject: subject, | |
canBeUpdated: true, | |
identifier: removedRelatedEntityRelationId, | |
- changeMaps: [{ | |
- relation: relation.inverseRelation, | |
- value: null | |
- }] | |
+ mustBeRemoved: !relation.inverseRelation.isNullable ? true : undefined, | |
+ changeMaps: relation.inverseRelation.isNullable ? [{ | |
+ relation: relation.inverseRelation, | |
+ value: null | |
+ }] : undefined, | |
}); | |
_this.subjects.push(removedRelatedEntitySubject); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment