Merge branch 'master' into naveensrinivasan/dependabot

This commit is contained in:
Naveen 2022-03-11 18:36:40 -06:00 committed by GitHub
commit 486f9a126d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 = 11;
private static currentVersion = 12;
private queryTimeout = 120000;
private statisticsAddedIndexed = false;
@ -156,6 +156,11 @@ class DatabaseMigration {
await this.$executeQuery(connection, 'ALTER TABLE blocks MODIFY `fees` INT UNSIGNED NOT NULL DEFAULT "0"');
}
if (databaseSchemaVersion < 12 && isBitcoin === true) {
// No need to re-index because the new data type can contain larger values
await this.$executeQuery(connection, 'ALTER TABLE blocks MODIFY `fees` BIGINT UNSIGNED NOT NULL DEFAULT "0"');
}
connection.release();
} catch (e) {
connection.release();