[英]Simplest way to update Entities in Data Core without losing data
I have an iOS app on App Store that utilized Data Core with SQLite engine. 我在App Store上有一个iOS应用程序,它使用Data Core和SQLite引擎。 The updated version that I plan to update needed to add several more attributes (fields) to an entity (table). 我计划更新的更新版本需要向实体(表)添加多个属性(字段)。 What is the simplest way to handle this without losing data on already existing SQLite database? 在不丢失现有SQLite数据库数据的情况下处理此问题的最简单方法是什么?
The way to do this is with what's called a "Core Data Migration". 这样做的方法是使用所谓的“核心数据迁移”。
Here's the Core Data Model Versioning and Data Migration Programming Guide 这是核心数据模型版本控制和数据迁移编程指南
Also, some initial posts: 还有一些初步帖子:
Data migration with core data 使用核心数据进行数据迁移
http://www.timisted.net/blog/archive/core-data-migration/ http://www.timisted.net/blog/archive/core-data-migration/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.