I have an app for which I generate a seed core data database in a Mac command line program with Xcode. During beta-testing I used several model versions. Now, for the first release of the app, I want to squash the versions into one model with version 1. Is that even possible?
I removed the old model versions from the xcdatamodeld folder and set the current version to the initial one. I removed both references to the old model versions from the pbxproj file. Regardless of what I try, I get a "Persistent store migration failed, missing mapping model."-error. I tried everything listed here, namely:
- cleaned project, exit Xcode
- remove generated database from documents folder
- remove binaries
- remove all Derived Data
- run
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
- delete cache from
~/Library/Caches/com.apple.dt.Xcode
Nothing helped. I am wondering from where Xcode could know about the old model... For clarification, this is referring to the database creation tool I run as a command line app on the mac, not the iOS app itself.
Other ways to squash the db are well appreciated. One alternative I am considering is renaming the database and ignoring the old one from now on.