Add db migration to remove bad price data

This commit is contained in:
Mononaut
2025-08-01 07:08:24 +00:00
parent c4b6f0b35d
commit 35cd476d0e

View File

@@ -7,7 +7,7 @@ import cpfpRepository from '../repositories/CpfpRepository';
import { RowDataPacket } from 'mysql2'; import { RowDataPacket } from 'mysql2';
class DatabaseMigration { class DatabaseMigration {
private static currentVersion = 100; private static currentVersion = 101;
private queryTimeout = 3600_000; private queryTimeout = 3600_000;
private statisticsAddedIndexed = false; private statisticsAddedIndexed = false;
private uniqueLogs: string[] = []; private uniqueLogs: string[] = [];
@@ -1299,6 +1299,10 @@ class DatabaseMigration {
queries.push(`DELETE FROM state WHERE name = 'last_weekly_hashrates_indexing'`); queries.push(`DELETE FROM state WHERE name = 'last_weekly_hashrates_indexing'`);
} }
if (version < 101) {
queries.push(`DELETE FROM prices WHERE USD = -1`);
}
return queries; return queries;
} }