mirror of
https://github.com/mempool/mempool.git
synced 2025-03-15 12:20:28 +01:00
split new liquid db indexes into separate migrations
This commit is contained in:
parent
e05f5ee751
commit
bfd771056d
1 changed files with 24 additions and 16 deletions
|
@ -7,7 +7,7 @@ import cpfpRepository from '../repositories/CpfpRepository';
|
||||||
import { RowDataPacket } from 'mysql2';
|
import { RowDataPacket } from 'mysql2';
|
||||||
|
|
||||||
class DatabaseMigration {
|
class DatabaseMigration {
|
||||||
private static currentVersion = 92;
|
private static currentVersion = 93;
|
||||||
private queryTimeout = 3600_000;
|
private queryTimeout = 3600_000;
|
||||||
private statisticsAddedIndexed = false;
|
private statisticsAddedIndexed = false;
|
||||||
private uniqueLogs: string[] = [];
|
private uniqueLogs: string[] = [];
|
||||||
|
@ -776,23 +776,31 @@ class DatabaseMigration {
|
||||||
await this.updateToSchemaVersion(91);
|
await this.updateToSchemaVersion(91);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// elements_pegs indexes
|
||||||
if (databaseSchemaVersion < 92 && config.MEMPOOL.NETWORK === 'liquid') {
|
if (databaseSchemaVersion < 92 && config.MEMPOOL.NETWORK === 'liquid') {
|
||||||
// elements_pegs
|
await this.$executeQuery(`
|
||||||
await this.$executeQuery('ALTER TABLE `elements_pegs` ADD INDEX `block` (`block`)');
|
ALTER TABLE \`elements_pegs\`
|
||||||
await this.$executeQuery('ALTER TABLE `elements_pegs` ADD INDEX `datetime` (`datetime`)');
|
ADD INDEX \`block\` (\`block\`),
|
||||||
await this.$executeQuery('ALTER TABLE `elements_pegs` ADD INDEX `amount` (`amount`)');
|
ADD INDEX \`datetime\` (\`datetime\`),
|
||||||
await this.$executeQuery('ALTER TABLE `elements_pegs` ADD INDEX `bitcoinaddress` (`bitcoinaddress`)');
|
ADD INDEX \`amount\` (\`amount\`),
|
||||||
await this.$executeQuery('ALTER TABLE `elements_pegs` ADD INDEX `bitcointxid` (`bitcointxid`)');
|
ADD INDEX \`bitcoinaddress\` (\`bitcoinaddress\`),
|
||||||
|
ADD INDEX \`bitcointxid\` (\`bitcointxid\`)
|
||||||
|
`);
|
||||||
|
await this.updateToSchemaVersion(92);
|
||||||
|
}
|
||||||
|
|
||||||
// federation_txos
|
// federation_txos indexes
|
||||||
await this.$executeQuery('ALTER TABLE `federation_txos` ADD INDEX `unspent` (`unspent`)');
|
if (databaseSchemaVersion < 93 && config.MEMPOOL.NETWORK === 'liquid') {
|
||||||
await this.$executeQuery('ALTER TABLE `federation_txos` ADD INDEX `lastblockupdate` (`lastblockupdate`)');
|
await this.$executeQuery(`
|
||||||
await this.$executeQuery('ALTER TABLE `federation_txos` ADD INDEX `blocktime` (`blocktime`)');
|
ALTER TABLE \`federation_txos\`
|
||||||
await this.$executeQuery('ALTER TABLE `federation_txos` ADD INDEX `emergencyKey` (`emergencyKey`)');
|
ADD INDEX \`unspent\` (\`unspent\`),
|
||||||
await this.$executeQuery('ALTER TABLE `federation_txos` ADD INDEX `expiredAt` (`expiredAt`)');
|
ADD INDEX \`lastblockupdate\` (\`lastblockupdate\`),
|
||||||
await this.$executeQuery('ALTER TABLE `federation_txos` ADD INDEX `balance` (`balance`)');
|
ADD INDEX \`blocktime\` (\`blocktime\`),
|
||||||
|
ADD INDEX \`emergencyKey\` (\`emergencyKey\`),
|
||||||
await this.updateToSchemaVersion(85);
|
ADD INDEX \`expiredAt\` (\`expiredAt\`),
|
||||||
|
ADD INDEX \`balance\` (\`balance\`)
|
||||||
|
`);
|
||||||
|
await this.updateToSchemaVersion(93);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue