diff --git a/backend/src/migrations/1608753440716-CreateTempBansTable.ts b/backend/src/migrations/1608753440716-CreateTempBansTable.ts index 7599506e..7345d34c 100644 --- a/backend/src/migrations/1608753440716-CreateTempBansTable.ts +++ b/backend/src/migrations/1608753440716-CreateTempBansTable.ts @@ -1,8 +1,8 @@ -import { MigrationInterface, QueryRunner, Table } from "typeorm"; +import { MigrationInterface, QueryRunner, Table, TableIndex } from "typeorm"; export class CreateTempBansTable1608753440716 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { - await queryRunner.createTable( + const table = await queryRunner.createTable( new Table({ name: "tempbans", columns: [ @@ -31,6 +31,12 @@ export class CreateTempBansTable1608753440716 implements MigrationInterface { ], }), ); + queryRunner.createIndex( + "tempbans", + new TableIndex({ + columnNames: ["expires_at"], + }), + ); } public async down(queryRunner: QueryRunner): Promise {