zappyzep/backend/src/migrations/1631474131804-AddIndexToIsBot.ts

22 lines
531 B
TypeScript
Raw Normal View History

2021-09-12 22:17:22 +03:00
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"],
}),
);
}
}