Open StevenAppJob opened 5 years ago
Hi @StevenAppJob, I had faced DB migration issue. I am using latest version of pods. I want to confirm, if you are doing DB migration in below way, it worked for me:
let configuration = EncryptedStoreFileManagerConfiguration()
configuration.fileManager = FileManager.default
configuration.databaseURL = persistentStoreURL
configuration.bundle = Bundle(for: type(of: self))
let options:[AnyHashable:Any] = [EncryptedStorePassphraseKey: dbPassword as Any,
EncryptedStoreDatabaseLocation: description as Any,
NSMigratePersistentStoresAutomaticallyOption: true as Any,
NSInferMappingModelAutomaticallyOption: true as Any,
EncryptedStoreFileManagerOption: EncryptedStoreFileManager(configuration: configuration) as Any,
EncryptedStoreCacheSize: 5000]
coordinator = EncryptedStore.make(options: options,
managedObjectModel: managedObjectModel)
Thanks @ankitthakur, I will try it and let you know..
Hi @ankitthakur,
The code above, is it inside the EncryotedStore Class?
Hi, We are using this EncryptedStore many years, and we didn't update the library until now, only we updated sqlite library, the problem we have now, when I do lightweight immigration, the add persistent return nil and error nil also. I tried to update the library, when I update the library the immigration works but the first time when I update, I lose all my data in core-data. Is there away to update my library and not lose all my data?
Thanks