Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with lightweight immigration. #321

Open
StevenAppJob opened this issue Feb 19, 2019 · 3 comments
Open

Issue with lightweight immigration. #321

StevenAppJob opened this issue Feb 19, 2019 · 3 comments

Comments

@StevenAppJob
Copy link

StevenAppJob commented Feb 19, 2019

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

@ankitthakur
Copy link

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)

@StevenAppJob
Copy link
Author

Thanks @ankitthakur,
I will try it and let you know..

@StevenAppJob
Copy link
Author

Hi @ankitthakur,

The code above, is it inside the EncryotedStore Class?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants