3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-23 17:45:03 +00:00

Add index on messages.is_bot

This commit is contained in:
Dragory 2021-09-12 22:17:22 +03:00
parent 0e02edd655
commit 209a9a8214

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"],
}),
);
}
}