Truncate hashrates table only for bitcoin (db migration v9)

This commit is contained in:
nymkappa 2022-03-07 15:56:07 +01:00
parent 641fa91a48
commit 32d66c03c6
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04

View File

@ -133,7 +133,7 @@ class DatabaseMigration {
await this.$executeQuery(connection, 'ALTER TABLE `hashrates` ADD `type` enum("daily", "weekly") DEFAULT "daily"');
}
if (databaseSchemaVersion < 9) {
if (databaseSchemaVersion < 9 && 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 `state` CHANGE `name` `name` varchar(100)');