I have a Flutter app and I am using Hive to store data.
I have deleted some adapters which were used previously. This caused an error and I have to delete the old database.
Now, if I roll out an update, how do I make sure the old Hive database gets deleted when the user updates the app so that it causes no issues.
Instead of deleting, run a database migration.
Hive.box("myBox", version: 5, migrator: (oldVersion, newVersion, box) async { await box.delete("unusedKey"); await box.put("newKey", 7); });
If you want to delete it anyway,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With