2022-11-22 05:11:29 -08:00
|
|
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
2023-01-24 01:55:20 -08:00
|
|
|
import { getTablePrefix } from '@/databases/utils/migrationHelpers';
|
2020-07-17 08:08:40 -07:00
|
|
|
|
|
|
|
export class CreateIndexStoppedAt1594828256133 implements MigrationInterface {
|
2020-07-26 02:33:20 -07:00
|
|
|
name = 'CreateIndexStoppedAt1594828256133';
|
2020-07-17 08:08:40 -07:00
|
|
|
|
2020-07-26 02:33:20 -07:00
|
|
|
async up(queryRunner: QueryRunner): Promise<void> {
|
2023-01-24 01:55:20 -08:00
|
|
|
const tablePrefix = getTablePrefix();
|
2022-11-22 05:11:29 -08:00
|
|
|
await queryRunner.query(
|
2023-01-24 01:55:20 -08:00
|
|
|
`CREATE INDEX IF NOT EXISTS IDX_${tablePrefix}33228da131bb1112247cf52a42 ON ${tablePrefix}execution_entity ("stoppedAt") `,
|
2022-11-22 05:11:29 -08:00
|
|
|
);
|
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> {
|
2023-01-24 01:55:20 -08:00
|
|
|
const tablePrefix = getTablePrefix();
|
|
|
|
await queryRunner.query(`DROP INDEX IDX_${tablePrefix}33228da131bb1112247cf52a42`);
|
2020-07-26 02:33:20 -07:00
|
|
|
}
|
2020-07-17 08:08:40 -07:00
|
|
|
}
|