2019-01-13 17:29:26 +02:00
|
|
|
import { MigrationInterface, QueryRunner, TableColumn, TableIndex } from "typeorm";
|
|
|
|
|
|
|
|
export class AddIndexToArchivesExpiresAt1547392046629 implements MigrationInterface {
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<any> {
|
|
|
|
await queryRunner.createIndex(
|
|
|
|
"archives",
|
|
|
|
new TableIndex({
|
2019-11-02 22:11:26 +02:00
|
|
|
columnNames: ["expires_at"],
|
|
|
|
}),
|
2019-01-13 17:29:26 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<any> {
|
|
|
|
await queryRunner.dropIndex(
|
|
|
|
"archives",
|
|
|
|
new TableIndex({
|
2019-11-02 22:11:26 +02:00
|
|
|
columnNames: ["expires_at"],
|
|
|
|
}),
|
2019-01-13 17:29:26 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|