diff --git a/mm2src/coins/nft/storage/sql_storage.rs b/mm2src/coins/nft/storage/sql_storage.rs index b7f2b911c4..607b12ebe7 100644 --- a/mm2src/coins/nft/storage/sql_storage.rs +++ b/mm2src/coins/nft/storage/sql_storage.rs @@ -1467,7 +1467,9 @@ impl NftMigrationOps for AsyncMutexGuard<'_, AsyncConnection> { while version < CURRENT_SCHEMA_VERSION_TX_HISTORY { match version { 0 => { - migrate_tx_history_table_to_schema_v2(conn, history_table.clone(), schema_table.clone())?; + migrate_tx_history_table_to_schema_v2(conn, history_table, schema_table)?; + // Stop the while loop after performing the upgrade for version 0, as in function above we already made schema up to date + break; }, 1 => { // The Tx History SQL schema didn't have version 1, but let's handle this case diff --git a/mm2src/coins/nft/storage/wasm/wasm_storage.rs b/mm2src/coins/nft/storage/wasm/wasm_storage.rs index 321254f140..fc69b65b81 100644 --- a/mm2src/coins/nft/storage/wasm/wasm_storage.rs +++ b/mm2src/coins/nft/storage/wasm/wasm_storage.rs @@ -932,6 +932,8 @@ impl TableSignature for NftListTable { )?; table.create_index("chain", false)?; table.create_index("block_number", false)?; + // Stop the while loop after performing the upgrade for version 0 + break; }, 1 => { // nothing to change @@ -1031,6 +1033,8 @@ impl TableSignature for NftTransferHistoryTable { table.create_multi_index(CHAIN_IMAGE_DOMAIN_INDEX, &["chain", "image_domain"], false)?; table.create_index("block_number", false)?; table.create_index("chain", false)?; + // Stop the while loop after performing the upgrade for version 0 + break; }, 1 => { let table = upgrader.open_table(Self::TABLE_NAME)?; @@ -1071,6 +1075,8 @@ impl TableSignature for LastScannedBlockTable { 0 => { let table = upgrader.create_table(Self::TABLE_NAME)?; table.create_index("chain", true)?; + // Stop the while loop after performing the upgrade for version 0 + break; }, 1 => { // nothing to change