n8n/packages/cli/src/databases/migrations/postgresdb/1594828256133-CreateIndexStoppedAt.ts

19 lines
696 B
TypeScript
Raw Normal View History

import { MigrationInterface, QueryRunner } from 'typeorm';
import { getTablePrefix } from '@/databases/utils/migrationHelpers';
export class CreateIndexStoppedAt1594828256133 implements MigrationInterface {
2020-07-26 02:33:20 -07:00
name = 'CreateIndexStoppedAt1594828256133';
2020-07-26 02:33:20 -07:00
async up(queryRunner: QueryRunner): Promise<void> {
const tablePrefix = getTablePrefix();
await queryRunner.query(
`CREATE INDEX IF NOT EXISTS IDX_${tablePrefix}33228da131bb1112247cf52a42 ON ${tablePrefix}execution_entity ("stoppedAt") `,
);
2020-07-26 02:33:20 -07:00
}
2020-07-26 02:33:20 -07:00
async down(queryRunner: QueryRunner): Promise<void> {
const tablePrefix = getTablePrefix();
await queryRunner.query(`DROP INDEX IDX_${tablePrefix}33228da131bb1112247cf52a42`);
2020-07-26 02:33:20 -07:00
}
}