zappyzep/src/migrations/1547392046629-AddIndexToArchivesExpiresAt.ts

22 lines
558 B
TypeScript
Raw Normal View History

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({
columnNames: ["expires_at"]
})
);
}
public async down(queryRunner: QueryRunner): Promise<any> {
await queryRunner.dropIndex(
"archives",
new TableIndex({
columnNames: ["expires_at"]
})
);
}
}