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:
parent
6a79a59fb8
commit
92ac9c21ad
1 changed files with 21 additions and 0 deletions
21
backend/src/migrations/1631474131804-AddIndexToIsBot.ts
Normal file
21
backend/src/migrations/1631474131804-AddIndexToIsBot.ts
Normal 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"],
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue