From f923ee4edef8bb945f8c42b61372d53d06fcaf99 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Mon, 4 Mar 2024 16:32:43 +0000 Subject: [PATCH] Accelerator audit use datetime for added column --- backend/src/api/database-migration.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/src/api/database-migration.ts b/backend/src/api/database-migration.ts index 539316e39..861830226 100644 --- a/backend/src/api/database-migration.ts +++ b/backend/src/api/database-migration.ts @@ -7,7 +7,7 @@ import cpfpRepository from '../repositories/CpfpRepository'; import { RowDataPacket } from 'mysql2'; class DatabaseMigration { - private static currentVersion = 69; + private static currentVersion = 70; private queryTimeout = 3600_000; private statisticsAddedIndexed = false; private uniqueLogs: string[] = []; @@ -585,6 +585,11 @@ class DatabaseMigration { await this.$executeQuery(this.getCreateAccelerationsTableQuery(), await this.$checkIfTableExists('accelerations')); await this.updateToSchemaVersion(69); } + + if (databaseSchemaVersion < 70 && config.MEMPOOL.NETWORK === 'mainnet') { + await this.$executeQuery('ALTER TABLE accelerations MODIFY COLUMN added DATETIME;'); + await this.updateToSchemaVersion(70); + } } /** @@ -1131,7 +1136,7 @@ class DatabaseMigration { private getCreateAccelerationsTableQuery(): string { return `CREATE TABLE IF NOT EXISTS accelerations ( txid varchar(65) NOT NULL, - added date NOT NULL, + added datetime NOT NULL, height int(10) NOT NULL, pool smallint unsigned NULL, effective_vsize int(10) NOT NULL,