删除后保留保留的核心数据迁移

时间:2020-05-29 13:44:09

标签: ios swift sqlite core-data migration

我正在使用CoreData。 我的CoreDataManager来自 https://williamboles.me/progressive-core-data-migration/

我只是进行标准迁移,

我设置了新版本的属性之一,以保留“删除后为True”。

然后返回如下迁移函数中的错误。 enter image description here

我只是为迁移功能设置了如下所示的选项,但它无法成功迁移。


            do {
                let options = [NSPersistentHistoryTrackingKey: true as NSNumber]
                try manager.migrateStore(from: currentURL, sourceType: NSSQLiteStoreType, options: options, with: migrationStep.mappingModel, toDestinationURL: destinationURL, destinationType: NSSQLiteStoreType, destinationOptions: options)
            } catch let error {
                fatalError("failed attempting to migrate from \(migrationStep.sourceModel) to \(migrationStep.destinationModel), error: \(error)")
            }

如何解决该错误?

0 个答案:

没有答案