Merge pull request #1112 from nymkappa/feature/index-added-field

INDEX 'added' in statistics table
This commit is contained in:
wiz 2022-01-11 03:09:20 +00:00 committed by GitHub
commit cee52e69f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@ import { DB } from '../database';
import logger from '../logger'; import logger from '../logger';
class DatabaseMigration { class DatabaseMigration {
private static currentVersion = 1; private static currentVersion = 2;
private queryTimeout = 120000; private queryTimeout = 120000;
constructor() { } constructor() { }
@ -171,6 +171,10 @@ class DatabaseMigration {
queries.push(`INSERT INTO state VALUES('last_elements_block', 0, NULL);`); queries.push(`INSERT INTO state VALUES('last_elements_block', 0, NULL);`);
} }
if (version < 2) {
queries.push(`CREATE INDEX IF NOT EXISTS added ON statistics (added);`);
}
return queries; return queries;
} }
} }