From 04bc41df3bb0b56720e1cfb1e4faad862b9abbe9 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Thu, 19 May 2022 12:13:43 +0200 Subject: [PATCH] Index blocks.hash --- backend/src/api/database-migration.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/api/database-migration.ts b/backend/src/api/database-migration.ts index 80c338a20..8fb534dc5 100644 --- a/backend/src/api/database-migration.ts +++ b/backend/src/api/database-migration.ts @@ -4,7 +4,7 @@ import logger from '../logger'; import { Common } from './common'; class DatabaseMigration { - private static currentVersion = 17; + private static currentVersion = 18; private queryTimeout = 120000; private statisticsAddedIndexed = false; @@ -180,6 +180,10 @@ class DatabaseMigration { if (databaseSchemaVersion < 17 && isBitcoin === true) { await this.$executeQuery('ALTER TABLE `pools` ADD `slug` CHAR(50) NULL'); } + + if (databaseSchemaVersion < 18 && isBitcoin === true) { + await this.$executeQuery('ALTER TABLE `blocks` ADD INDEX `hash` (`hash`);'); + } } catch (e) { throw e; }