diff --git a/backend/src/migrations/1631474131804-AddIndexToIsBot.ts b/backend/src/migrations/1631474131804-AddIndexToIsBot.ts new file mode 100644 index 00000000..db839d97 --- /dev/null +++ b/backend/src/migrations/1631474131804-AddIndexToIsBot.ts @@ -0,0 +1,21 @@ +import { MigrationInterface, QueryRunner, TableIndex } from "typeorm"; + +export class AddIndexToIsBot1631474131804 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.createIndex( + "messages", + new TableIndex({ + columnNames: ["is_bot"], + }), + ); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.dropIndex( + "messages", + new TableIndex({ + columnNames: ["is_bot"], + }), + ); + } +}