Ios 通过iTunes/AppStore更新应用程序时更新SQLite数据库

Ios 通过iTunes/AppStore更新应用程序时更新SQLite数据库,ios,sqlite,Ios,Sqlite,在通过应用商店进行应用程序更新期间,我想用更多内容更新SQLite数据库文件。 旧的SQLite文件位于我的应用程序的文档文件夹中 我该怎么处理 sqlite> attach 'path_to_table.db3' as toMerge; sqlite> insert into MyTableToInsertTo select * from toMerge.MyTableToInsertFrom; sqlite> detach database toMe

在通过应用商店进行应用程序更新期间,我想用更多内容更新SQLite数据库文件。 旧的SQLite文件位于我的应用程序的
文档
文件夹中

我该怎么处理

sqlite> attach 'path_to_table.db3' as toMerge;           
sqlite> insert into MyTableToInsertTo select * from toMerge.MyTableToInsertFrom; 
sqlite> detach database toMerge; 
使用BEGIN;犯罪对于大数据


我假设您没有使用核心数据,否则您将使用自动迁移功能。对于straight SQLLite,您需要创建一个新的数据库文件。然后,根据模式更改的性质,您可能能够执行查询以将数据复制到(
使用INSERT INTO destination SELECT*FROM source
)。但是,如果更改太多,无法用一组简单的查询来处理,例如,如果它涉及业务逻辑,那么您可能需要编写一个脚本,将旧数据从一个数据库转换为新数据库。

最初是如何创建SQLite数据库的?它是在站点Xcode之外手动创建和填充的,然后添加到捆绑包中