2020-07-26 02:33:20 -07:00
|
|
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
2020-07-17 08:08:40 -07:00
|
|
|
|
|
|
|
import * as config from '../../../../config';
|
|
|
|
|
|
|
|
export class CreateIndexStoppedAt1594825041918 implements MigrationInterface {
|
2020-07-26 02:33:20 -07:00
|
|
|
name = 'CreateIndexStoppedAt1594825041918';
|
2020-07-17 08:08:40 -07:00
|
|
|
|
2020-07-26 02:33:20 -07:00
|
|
|
async up(queryRunner: QueryRunner): Promise<void> {
|
2020-07-17 08:08:40 -07:00
|
|
|
const tablePrefix = config.get('database.tablePrefix');
|
|
|
|
|
2021-01-23 11:00:32 -08:00
|
|
|
await queryRunner.query(`CREATE INDEX "IDX_${tablePrefix}cefb067df2402f6aed0638a6c1" ON "${tablePrefix}execution_entity" ("stoppedAt") `);
|
2020-07-26 02:33:20 -07:00
|
|
|
}
|
2020-07-17 08:08:40 -07:00
|
|
|
|
2020-07-26 02:33:20 -07:00
|
|
|
async down(queryRunner: QueryRunner): Promise<void> {
|
2020-07-17 08:08:40 -07:00
|
|
|
const tablePrefix = config.get('database.tablePrefix');
|
|
|
|
|
2020-07-26 02:33:20 -07:00
|
|
|
await queryRunner.query(`DROP INDEX "IDX_${tablePrefix}cefb067df2402f6aed0638a6c1"`);
|
|
|
|
}
|
2020-07-17 08:08:40 -07:00
|
|
|
|
|
|
|
}
|