TF-2177 Upgrade hive database version and clear all account data

Signed-off-by: dab246 <tdvu@linagora.com>
(cherry picked from commit 91b7e5406029dc8cbdffdadcc3a9282124180623)
This commit is contained in:
dab246
2023-10-24 13:01:31 +07:00
committed by Dat H. Pham
parent 013014f0b5
commit 6a0b3a7bc4
2 changed files with 4 additions and 1 deletions
@@ -104,6 +104,9 @@ class CachingManager {
Future<void> onUpgradeCache(int oldVersion, int newVersion) async {
log('CachingManager::onUpgradeCache():oldVersion $oldVersion | newVersion: $newVersion');
await clearData();
if (oldVersion > 0 && oldVersion < newVersion && newVersion == 7) {
await clearAll();
}
await storeCacheVersion(newVersion);
}
@@ -1,4 +1,4 @@
class CacheVersion {
static const int hiveDBVersion = 6;
static const int hiveDBVersion = 7;
}