Remove unnecessary migration version 15

This commit is contained in:
nymkappa 2022-03-13 16:04:49 +01:00
parent 0730053d5d
commit edddf25917
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04

View File

@ -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();