Core Data migration then run old app version

I'm sorta baffled right now. I am trying to wonder how I might detect a updated SQL Store in an older app.

  • have a baseline app, and create a SQL-based repository

  • in an updated app, change the model and verify that you can see the updated model version. Using lightweight migration

  • re-run the older app (which will inherit the newer SQL repository).

YIKES - no error when creating the NSPersistenStoreCoordinator!

Nothing in the metadata to imply the store is newer than the model:

[_persistentStoreCoordinator metadataForPersistentStore:store]

My question: is there any way to detect this condition?

David

Answered by dhoerl in 815638022

Update:

I've been running the app in Xcode for quite some time now, switching between newer and older versions of the code, and Core Data seems perfectly happy in accepting a "newer" repository and "downgrading" it to an older revision.

I have never seen anything on this topic, but I guess the geniuses that developed Core Data anticipated this case!

It sure has made my life easier!

Accepted Answer

Update:

I've been running the app in Xcode for quite some time now, switching between newer and older versions of the code, and Core Data seems perfectly happy in accepting a "newer" repository and "downgrading" it to an older revision.

I have never seen anything on this topic, but I guess the geniuses that developed Core Data anticipated this case!

It sure has made my life easier!

Core Data migration then run old app version
 
 
Q