Why not build on what you’ve learned by experimenting?
- Set the current model version to Model 3 and run the application. It should not throw an error because the downgrade of data is inferred automatically. Note that this is only because NSInferMappingModelAutomaticallyOption has been re-enabled. In reality, you would need a Model4toModel3 mapping model to map attributes properly.
- Examine the contents of the ZAMOUNT table in LocalStore.sqlite and you’ll notice something critical: Where has all the data gone? There was no mapping model, so all the ZUNIT data was lost during the downgrade!
- Set the current model to Model 4 and then run the application to trigger an automatic lightweight migration. This should be fast because there is no data in the store.