Re-index hashrates because we have different timestamp handling

This commit is contained in:
nymkappa 2022-03-06 16:48:14 +01:00
parent 89411f23d8
commit 4b859eb4f6
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04

View File

@ -134,6 +134,8 @@ class DatabaseMigration {
}
if (databaseSchemaVersion < 9) {
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)');
await this.$executeQuery(connection, 'ALTER TABLE `hashrates` ADD UNIQUE `hashrate_timestamp_pool_id` (`hashrate_timestamp`, `pool_id`)');
}