mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-12 04:10:36 +01:00
Store is not deleted on model mismatch with .recreateStoreOnModelMismatch option #105
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @andriichernenko on GitHub (Nov 25, 2016).
I include
.recreateStoreOnModelMismatchin the store options, but it doesn't seem to do what it is supposed to. Application still crashes after I change the model.The issue seems to be somewhere in this code:
As I understand,
self.model[metadata]subscript tries to find the model by entity hashes (NSStoreModelVersionHashesKey) which is suspicious (I thought these hashes are different by definition when models are different?):@JohnEstropia commented on GitHub (Nov 26, 2016):
I completely missed this case, thanks so much! Will try to push a fix within the day
@JohnEstropia commented on GitHub (Nov 26, 2016):
Just to note:
The original assumption is that all previous model versions are bundled in the app (or theres no way we can infer how to migrate).
I missed the case where we change our model while debugging, which was what this flag was originally designed for :(
@JohnEstropia commented on GitHub (Nov 26, 2016):
@deville I updated the swift3_develop branch. Try it out :)
@andriichernenko commented on GitHub (Nov 26, 2016):
The problem has been resolved, thank you!