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

export class AlterGroupTableToMakeShareableTrue1731050293440
  implements MigrationInterface
{
  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.changeColumn(
      'groups',
      'is_shareable',
      new TableColumn({
        name: 'is_shareable',
        type: 'boolean',
        default: true,
        isNullable: true,
      }),
    );
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.changeColumn(
      'groups',
      'is_shareable',
      new TableColumn({
        name: 'is_shareable',
        type: 'boolean',
        default: false,
        isNullable: true,
      }),
    );
  }
}
