3Squared / SQKDataKit

Lightweight Core Data helper to reduce boilerplate code.
MIT License
19 stars 6 forks source link

Model Migrator is broken since iOS 7 #88

Open blork opened 4 years ago

blork commented 4 years ago

SQKModelMigrator.m generates a new SQLIte file then moves this into the place of the previous file. Since iOS7, moving just the SQLite file is not enough, since there are new index/transaction files stored alongside it. iOS will attempt to use these old metafiles with the new SQLite file. This means if the migrator runs, the SQLite file that it generates cannot be opened by iOS and it believes it to be corrupted.

I believe the solution would be to also delete the other files (-WAL, -SHM). As this project is archived, this will not be fixed. If you still need to use it, then just pass nil as the argument for orderedManagedObjectModelNames. You will lose the migration behaviour, but it is broken anyway.