import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddPlayerLookupIndexes1785517200000 implements MigrationInterface {
  name = 'AddPlayerLookupIndexes1785517200000';

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      'CREATE INDEX "IDX_player_team_id" ON "player" ("teamId")',
    );
    await queryRunner.query(
      'CREATE INDEX "IDX_player_user_id" ON "player" ("userId")',
    );
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query('DROP INDEX "IDX_player_user_id"');
    await queryRunner.query('DROP INDEX "IDX_player_team_id"');
  }
}
