From edddf25917816a837b8281cd834385903a01c348 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Sun, 13 Mar 2022 16:04:49 +0100 Subject: [PATCH] Remove unnecessary migration version 15 --- backend/src/api/database-migration.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/backend/src/api/database-migration.ts b/backend/src/api/database-migration.ts index f68f7f17d..c9c1da8e8 100644 --- a/backend/src/api/database-migration.ts +++ b/backend/src/api/database-migration.ts @@ -6,7 +6,7 @@ import logger from '../logger'; const sleep = (ms: number) => new Promise(res => setTimeout(res, ms)); class DatabaseMigration { - private static currentVersion = 15; + private static currentVersion = 14; private queryTimeout = 120000; private statisticsAddedIndexed = false; @@ -175,12 +175,6 @@ class DatabaseMigration { await this.$executeQuery(connection, 'ALTER TABLE `hashrates` MODIFY `pool_id` SMALLINT UNSIGNED NOT NULL DEFAULT "0"'); } - if (databaseSchemaVersion < 15 && isBitcoin === true) { - logger.warn(`'hashrates' table has been truncated. Re-indexing from scratch.`); - await this.$executeQuery(connection, 'TRUNCATE hashrates;'); // Need to re-index - await this.$executeQuery(connection, 'ALTER TABLE `hashrates` MODIFY `avg_hashrate` DOUBLE UNSIGNED NOT NULL DEFAULT "0"'); - } - connection.release(); } catch (e) { connection.release();