ios - .appname.sqlite.migrationdestination_xxxx 文件是什么?它会导致sql损坏错误吗?

标签 ios sqlite core-data corruption core-data-migration

我正在使用 CoreData 开发 iOS 应用程序。
我从用户那里得到了应用程序数据,其中包括以下隐藏文件。

  • 文档/.appname.sqlite.migrationdestination_xxxx (549MB)
  • 文档/.appname.sqlite.migrationdestination_xxxx-shm (721KB)
  • Documents/.appname.sqlite.migrationdestination_xxxx-wal (0Byte)

并且在同一个Documents文件夹中有appname.sqlite, appname.sqlite-wal 和appname.sqlite-shm。
appname.sqlite是app的主sql文件。而-wal,-shm好像是iOS自动生成的。
(我从 What are the .db-shm and .db-wal extensions in Sqlite databases? 学到的)

我认为 migrationdestination 文件只是迁移的进度数据。
当用户的设备无法迁移时,它可能仍然存在。 (例如,当我的应用程序长时间处于后台时,iOS 会终止我的应用程序。)

顺便说一句,一些使用我的应用程序的用户遇到了这个问题。

Mar 10 13:33:24 xxxx-xx-iPhone XXXXXXXX[5416] : CoreData: error: (11) Fatal error. The database at /var/mobile/Applications/95D2823D-37E4-4596-9507-B58571D32EBB/Documents/appname.sqlite is corrupted. SQLite error code:11, 'database disk image is malformed'

我发现了这个技巧。
Core Data store corruption

其中一个答案说 -wal 和 -shm 会导致此错误。所以我删除了它。
但是,用户仍然会遇到相同的错误。所以我认为 migrationdestination 可能会导致这个错误。
我会测试它明天删除。然后我将结果报告到这里。

所以有没有人有同样的问题、建议和答案?
感谢您阅读我的问题。

最佳答案

这些是迁移期间存在的文件。如果您看到这些文件,那么您的迁移失败了。检查该设备上的崩溃日志并确认。

您是否正在使用 -applicationDidFinishLaunching... 方法进行迁移?你有严重的食物崩溃吗?这些是导致迁移在迁移过程中失败的常见情况。

关于ios - .appname.sqlite.migrationdestination_xxxx 文件是什么?它会导致sql损坏错误吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22372558/

相关文章:

ios - tableview 方法的问题 func tableView(tableView : UITableView, editActionsForRowAtIndexPath indexPath : NSIndexPath) -> [UITableViewRowAction]?

ios - 可重复使用的 TableViewCell 异步高度

linux - sqlite3 和 bash,数据库设置

iphone - 核心数据不获取对象

core-data - 将 NSArray 转换为 Swift Array<T>

ios - tableview的Datasource数组的值自动变为0

python - 尝试迁移数据库时出错(slalchemy、slqite3)

android - 更改sqlite中列中的值

ios - 托管对象模型初始化

ios - 如何使用 Dropbox API 重新连接应用程序