开发者

CoreData lightweight migration: which exactly are "simple changes to your model" which CoreData can migrate automatically?

I'd like to use CoreData lightweight migration as much as possible, but could not find in the documentation, which exactly are the cases when this is possible. The documentation says: If you just make simple changes to your model (such as adding a new attribute to an entity), on Mac OS X v10.6 and later and on iPhone OS, Core Data can perform automatic data migration.

For Core Data to be able to do this, the changes must fit an obvious migration pattern, for example:

- Simple addition of a new attribute

- A non-optional attribute becoming optional

- An optional attribute becoming non-optional, and defining a default value

Well, I tried out also adding a new entity without relationships and deleting an existing entity (without relationships) and that worked for me automatically as well.

The question is: does anybody know what exactly are the simple c开发者_运维百科hanges which can be migrated automatically?


From WWDC 2010 Session 118 Mastering Core Data*:

Inferable Changes supported by lightweight migration

  • Add, remove, rename
  • Attributes - numerical type conversion
  • Relationships - promote to-one to to-many
  • Entities - change entity inheritance

*Video requires Apple Developer login

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜