mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-18 23:09:59 +00:00
31 lines
828 B
TypeScript
31 lines
828 B
TypeScript
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"],
|
|
}),
|
|
);
|
|
}
|
|
}
|