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

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

    await queryRunner.addColumn(
      'posts',
      new TableColumn({
        name: 'message',
        type: 'varchar',
        isNullable: true,
      }),
    );
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.dropColumn('posts', 'reason');
    await queryRunner.dropColumn('posts', 'message');
  }
}
