How many migration steps does Core Data lightweight migration have?

和自甴很熟 提交于 2019-12-06 05:30:31

Internally, I believe Core Data lightweight migration will apply the changes to each subsequent version in order, but for your purposes you can think of it as a migration that happens directly to the final version. To my knowledge there are no "hooks" to intercept and run code between versions during a lightweight migration.

If you need to alter data or add new data, you should determine the model version dynamically and react accordingly.

Core Data doesn't care about the order of versions and it doesn't care about any intermediate versions. It just knows the source version and target version, it will migrate directly between these.

Generally with lightweight migrations this will work fine though.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!