Add more indices to vc_alerts
This commit is contained in:
parent
f190e73c28
commit
0c1f7bda6c
1 changed files with 31 additions and 0 deletions
31
src/migrations/1562838838927-AddMoreIndicesToVCAlerts.ts
Normal file
31
src/migrations/1562838838927-AddMoreIndicesToVCAlerts.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import { MigrationInterface, QueryRunner, TableIndex } from "typeorm";
|
||||
|
||||
export class AddMoreIndicesToVCAlerts1562838838927 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<any> {
|
||||
const table = await queryRunner.getTable("vc_alerts");
|
||||
await table.addIndex(
|
||||
new TableIndex({
|
||||
columnNames: ["requestor_id"],
|
||||
}),
|
||||
);
|
||||
await table.addIndex(
|
||||
new TableIndex({
|
||||
columnNames: ["expires_at"],
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<any> {
|
||||
const table = await queryRunner.getTable("vc_alerts");
|
||||
await table.removeIndex(
|
||||
new TableIndex({
|
||||
columnNames: ["requestor_id"],
|
||||
}),
|
||||
);
|
||||
await table.removeIndex(
|
||||
new TableIndex({
|
||||
columnNames: ["expires_at"],
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue