3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-20 00:05:04 +00:00

Add index to expires_at

This commit is contained in:
Dark 2021-01-04 02:28:11 +01:00
parent 3032c51aad
commit 37cdb2e66b
No known key found for this signature in database
GPG key ID: 384C4B4F5B1E25A8

View file

@ -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<any> {
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<any> {