update deletion rules of related linkedItem entities

This commit is contained in:
Satindar Dhillon
2022-04-20 17:44:46 -07:00
parent 155c47b0d1
commit c921aebd87
2 changed files with 4 additions and 3 deletions

View File

@ -13,6 +13,7 @@
<attribute name="shortId" attributeType="String"/>
<attribute name="suffix" optional="YES" attributeType="String"/>
<attribute name="updatedAt" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<relationship name="linkedItem" maxCount="1" deletionRule="Nullify" destinationEntity="LinkedItem" inverseName="highlights" inverseEntity="LinkedItem"/>
<uniquenessConstraints>
<uniquenessConstraint>
<constraint value="id"/>
@ -36,7 +37,7 @@
<attribute name="savedAt" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="slug" attributeType="String"/>
<attribute name="title" attributeType="String"/>
<relationship name="highlights" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="Highlight"/>
<relationship name="highlights" toMany="YES" deletionRule="Cascade" destinationEntity="Highlight" inverseName="linkedItem" inverseEntity="Highlight"/>
<relationship name="labels" toMany="YES" deletionRule="Nullify" destinationEntity="LinkedItemLabel"/>
<uniquenessConstraints>
<uniquenessConstraint>
@ -87,7 +88,7 @@
</uniquenessConstraints>
</entity>
<elements>
<element name="Highlight" positionX="27" positionY="225" width="128" height="209"/>
<element name="Highlight" positionX="27" positionY="225" width="128" height="224"/>
<element name="LinkedItem" positionX="-18" positionY="63" width="128" height="299"/>
<element name="LinkedItemLabel" positionX="-36" positionY="18" width="128" height="104"/>
<element name="NewsletterEmail" positionX="0" positionY="180" width="128" height="74"/>

View File

@ -11,7 +11,7 @@ public class PersistentContainer: NSPersistentContainer {
container.viewContext.automaticallyMergesChangesFromParent = false
container.viewContext.name = "viewContext"
container.viewContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy
container.viewContext.mergePolicy = NSMergePolicy.mergeByPropertyObjectTrump
container.viewContext.undoManager = nil
container.viewContext.shouldDeleteInaccessibleFaults = true