Originally created by @SlinToWin on GitHub (Apr 23, 2018).
Hello,
i have a large CoreData Schema with round about 30 Entities and several relations. Implementation was done via CoreStoreObject
Now i want to add a property to one of my CoreStoreObjects.
Following the guide i created two Versions of my object, V1 and V2 and also created a typealias for the Name, so that i dont have to change all source files, where the object was used.
The Object has a relation to another CoreStoreObject. With this two Versions and the typealias, the build will fail because the inverse of the other CoreStoreObject cant be mapped to V1.
So i have to create also two versions for that one. This has relations to other Objects so i have to create also versions for that.
End of story is, that i have to create V2 for all 30 CoreStoreObjects, although only one object was changed because of the relations.
Is there any better way for doing that with CoreStoreObject (so that i just have to create Versions for Objects, which i really change?)
Originally created by @SlinToWin on GitHub (Apr 23, 2018).
Hello,
i have a large CoreData Schema with round about 30 Entities and several relations. Implementation was done via CoreStoreObject
Now i want to add a property to one of my CoreStoreObjects.
Following the guide i created two Versions of my object, V1 and V2 and also created a typealias for the Name, so that i dont have to change all source files, where the object was used.
The Object has a relation to another CoreStoreObject. With this two Versions and the typealias, the build will fail because the inverse of the other CoreStoreObject cant be mapped to V1.
So i have to create also two versions for that one. This has relations to other Objects so i have to create also versions for that.
End of story is, that i have to create V2 for all 30 CoreStoreObjects, although only one object was changed because of the relations.
Is there any better way for doing that with CoreStoreObject (so that i just have to create Versions for Objects, which i really change?)
adam
added the question label 2025-12-29 18:24:21 +01:00
End of story is, that i have to create V2 for all 30 CoreStoreObjects, although only one object was changed because of the relations.
In reality, relationship targets are also part of the data and will affect the versioning hash, so any updated entities will affect all related objects. How will an object know which version of it's relationship is it holding?
This replication is the same when you create a new version from an xcdatamodeld; all entities are always reflected on the new versions. The solution is also as simple as how xcdatamodeld does it:
Copy the old entities
Paste them on the new version
Edit the new version
Avoid editing the old version (i.e. VersionLock)
@JohnEstropia commented on GitHub (Apr 24, 2018):
> End of story is, that i have to create V2 for all 30 CoreStoreObjects, although only one object was changed because of the relations.
In reality, relationship targets are also part of the data and will affect the versioning hash, so any updated entities will affect all related objects. How will an object know which version of it's relationship is it holding?
This replication is the same when you create a new version from an `xcdatamodeld`; all entities are always reflected on the new versions. The solution is also as simple as how `xcdatamodeld` does it:
1. Copy the old entities
2. Paste them on the new version
3. Edit the new version
4. Avoid editing the old version (i.e. `VersionLock`)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @SlinToWin on GitHub (Apr 23, 2018).
Hello,
i have a large CoreData Schema with round about 30 Entities and several relations. Implementation was done via CoreStoreObject
Now i want to add a property to one of my CoreStoreObjects.
Following the guide i created two Versions of my object, V1 and V2 and also created a typealias for the Name, so that i dont have to change all source files, where the object was used.
The Object has a relation to another CoreStoreObject. With this two Versions and the typealias, the build will fail because the inverse of the other CoreStoreObject cant be mapped to V1.
So i have to create also two versions for that one. This has relations to other Objects so i have to create also versions for that.
End of story is, that i have to create V2 for all 30 CoreStoreObjects, although only one object was changed because of the relations.
Is there any better way for doing that with CoreStoreObject (so that i just have to create Versions for Objects, which i really change?)
@JohnEstropia commented on GitHub (Apr 24, 2018):
In reality, relationship targets are also part of the data and will affect the versioning hash, so any updated entities will affect all related objects. How will an object know which version of it's relationship is it holding?
This replication is the same when you create a new version from an
xcdatamodeld; all entities are always reflected on the new versions. The solution is also as simple as howxcdatamodelddoes it:VersionLock)