From 97e2f60c8537da81c05d4b3c15394ef58a9ccf51 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 6 Sep 2022 15:46:31 -0600 Subject: [PATCH] clean up migrate and add possible stuff for upcoming firo functionality --- lib/utilities/db_version_migration.dart | 28 ++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/lib/utilities/db_version_migration.dart b/lib/utilities/db_version_migration.dart index ec26c5c13..e3867ecc4 100644 --- a/lib/utilities/db_version_migration.dart +++ b/lib/utilities/db_version_migration.dart @@ -107,18 +107,36 @@ class DbVersionMigrator { } } - // finally update version + // update version await DB.instance.put( boxName: DB.boxNameDBInfo, key: "hive_data_version", value: 1); - return; - // not needed yet - // return migrate(1); + // try to continue migrating + return await migrate(1); // case 1: - // return migrate(2); + // await Hive.openBox(DB.boxNameAllWalletsData); + // final walletsService = WalletsService(); + // final walletInfoList = await walletsService.walletNames; + // for (final walletInfo in walletInfoList.values) { + // if (walletInfo.coin == Coin.firo) { + // await Hive.openBox(walletInfo.walletId); + // await DB.instance.delete( + // key: "latest_tx_model", boxName: walletInfo.walletId); + // await DB.instance.delete( + // key: "latest_lelantus_tx_model", boxName: walletInfo.walletId); + // } + // } + // + // // update version + // await DB.instance.put( + // boxName: DB.boxNameDBInfo, key: "hive_data_version", value: 2); + // + // // try to continue migrating + // return await migrate(2); default: + // finally return return; } }