import { MigrationInterface, QueryRunner } from "typeorm"

export class AlterCustomerLogEntityAllowNullValues1764148431888 implements MigrationInterface {
  name = "AlterCustomerLogEntityAllowNullValues1764148431888"

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `ALTER TABLE "episode_logs" ALTER COLUMN "log_date" DROP NOT NULL`,
    )
    await queryRunner.query(
      `ALTER TABLE "episode_logs" ALTER COLUMN "log_expiration" DROP NOT NULL`,
    )
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `ALTER TABLE "episode_logs" ALTER COLUMN "log_expiration" SET NOT NULL`,
    )
    await queryRunner.query(
      `ALTER TABLE "episode_logs" ALTER COLUMN "log_date" SET NOT NULL`,
    )
  }
}
