import { MigrationInterface, QueryRunner } from "typeorm"

export class AddFieldsToProject1768200441722 implements MigrationInterface {
  name = "AddFieldsToProject1768200441722"

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `ALTER TABLE "projects" ADD "is_threshold_mail_sent" smallint NOT NULL DEFAULT '0'`,
    )
    await queryRunner.query(
      `ALTER TABLE "projects" ADD "is_over_budget_mail_sent" smallint NOT NULL DEFAULT '0'`,
    )
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `ALTER TABLE "projects" DROP COLUMN "is_over_budget_mail_sent"`,
    )
    await queryRunner.query(
      `ALTER TABLE "projects" DROP COLUMN "is_threshold_mail_sent"`,
    )
  }
}
