import { MigrationInterface, QueryRunner } from 'typeorm'; export class PoolAccountingDashboardIndexes1780867200000 implements MigrationInterface { public name = 'PoolAccountingDashboardIndexes1780867200000'; public transaction = false; public async up(queryRunner: QueryRunner): Promise { await queryRunner.query(` CREATE INDEX IF NOT EXISTS "IDX_accepted_share_accepted_at" ON "accepted_share_entity" ("acceptedAt" DESC) `); await queryRunner.query(` CREATE INDEX IF NOT EXISTS "IDX_accepted_share_round_best" ON "accepted_share_entity" ("submissionDifficulty" DESC, "acceptedAt" DESC, "blockHeight") `); } public async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP INDEX IF EXISTS "IDX_accepted_share_round_best"`); await queryRunner.query(`DROP INDEX IF EXISTS "IDX_accepted_share_accepted_at"`); } }