3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Add index on messages.is_bot

This commit is contained in:
Dragory 2021-09-12 22:17:22 +03:00
parent 6a79a59fb8
commit 92ac9c21ad
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -0,0 +1,21 @@
import { MigrationInterface, QueryRunner, TableIndex } from "typeorm";
export class AddIndexToIsBot1631474131804 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createIndex(
"messages",
new TableIndex({
columnNames: ["is_bot"],
}),
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropIndex(
"messages",
new TableIndex({
columnNames: ["is_bot"],
}),
);
}
}