Merge remote-tracking branch 'origin/master' into nymkappa/feature/block-fee-usd-chart
This commit is contained in:
commit
a4946de028
@ -4,7 +4,7 @@ import logger from '../logger';
|
|||||||
import { Common } from './common';
|
import { Common } from './common';
|
||||||
|
|
||||||
class DatabaseMigration {
|
class DatabaseMigration {
|
||||||
private static currentVersion = 30;
|
private static currentVersion = 31;
|
||||||
private queryTimeout = 120000;
|
private queryTimeout = 120000;
|
||||||
private statisticsAddedIndexed = false;
|
private statisticsAddedIndexed = false;
|
||||||
private uniqueLogs: string[] = [];
|
private uniqueLogs: string[] = [];
|
||||||
@ -280,10 +280,15 @@ class DatabaseMigration {
|
|||||||
await this.$executeQuery('ALTER TABLE `nodes` ADD latitude double NULL DEFAULT NULL');
|
await this.$executeQuery('ALTER TABLE `nodes` ADD latitude double NULL DEFAULT NULL');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (databaseSchemaVersion < 30 && isBitcoin == true) { // Link blocks to prices
|
if (databaseSchemaVersion < 30 && isBitcoin === true) {
|
||||||
|
await this.$executeQuery('ALTER TABLE `geo_names` CHANGE `type` `type` enum("city","country","division","continent","as_organization") NOT NULL');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (databaseSchemaVersion < 31 && isBitcoin == true) { // Link blocks to prices
|
||||||
await this.$executeQuery('ALTER TABLE `prices` ADD `id` int NULL AUTO_INCREMENT UNIQUE');
|
await this.$executeQuery('ALTER TABLE `prices` ADD `id` int NULL AUTO_INCREMENT UNIQUE');
|
||||||
await this.$executeQuery('DROP TABLE IF EXISTS `blocks_prices`');
|
await this.$executeQuery('DROP TABLE IF EXISTS `blocks_prices`');
|
||||||
await this.$executeQuery(this.getCreateBlocksPricesTableQuery(), await this.$checkIfTableExists('blocks_prices'));
|
await this.$executeQuery(this.getCreateBlocksPricesTableQuery(), await this.$checkIfTableExists('blocks_prices'));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,6 +52,13 @@ export async function $lookupNodeLocation(): Promise<void> {
|
|||||||
`INSERT IGNORE INTO geo_names (id, type, names) VALUES (?, 'city', ?)`,
|
`INSERT IGNORE INTO geo_names (id, type, names) VALUES (?, 'city', ?)`,
|
||||||
[city.city?.geoname_id, JSON.stringify(city.city?.names)]);
|
[city.city?.geoname_id, JSON.stringify(city.city?.names)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Store AS name
|
||||||
|
if (asn.autonomous_system_organization) {
|
||||||
|
await DB.query(
|
||||||
|
`INSERT IGNORE INTO geo_names (id, type, names) VALUES (?, 'as_organization', ?)`,
|
||||||
|
[asn.autonomous_system_number, JSON.stringify(asn.autonomous_system_organization)]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user