2019-07-11 12:55:55 +03:00
|
|
|
import { MigrationInterface, QueryRunner, TableIndex } from "typeorm";
|
|
|
|
|
|
|
|
export class AddMoreIndicesToVCAlerts1562838838927 implements MigrationInterface {
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<any> {
|
2020-11-09 20:03:57 +02:00
|
|
|
const table = (await queryRunner.getTable("vc_alerts"))!;
|
2019-07-11 12:55:55 +03:00
|
|
|
await table.addIndex(
|
|
|
|
new TableIndex({
|
|
|
|
columnNames: ["requestor_id"],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
await table.addIndex(
|
|
|
|
new TableIndex({
|
|
|
|
columnNames: ["expires_at"],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<any> {
|
2020-11-09 20:03:57 +02:00
|
|
|
const table = (await queryRunner.getTable("vc_alerts"))!;
|
2019-07-11 12:55:55 +03:00
|
|
|
await table.removeIndex(
|
|
|
|
new TableIndex({
|
|
|
|
columnNames: ["requestor_id"],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
await table.removeIndex(
|
|
|
|
new TableIndex({
|
|
|
|
columnNames: ["expires_at"],
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|