import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';

export class AlterAppUserTable1711949664281 implements MigrationInterface {
  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.addColumn(
      'app_users',
      new TableColumn({
        name: 'current_streak',
        type: 'varchar',
        isNullable: true,
      }),
    );
    await queryRunner.addColumn(
      'app_users',
      new TableColumn({
        name: 'best_streak',
        type: 'varchar',
        isNullable: true,
      }),
    );
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.dropColumn('app_users', 'current_streak');
    await queryRunner.dropColumn('app_users', 'best_streak');
  }
}
