import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddSiretAndStatusBadgeToOrganizations1740000000003 implements MigrationInterface {
  name = 'AddSiretAndStatusBadgeToOrganizations1740000000003';

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`
      ALTER TABLE "organizations"
      ADD COLUMN "siret" VARCHAR(14),
      ADD COLUMN "siret_verified" BOOLEAN NOT NULL DEFAULT FALSE,
      ADD COLUMN "status_badge" VARCHAR(20) NOT NULL DEFAULT 'none'
    `);
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`
      ALTER TABLE "organizations"
      DROP COLUMN "status_badge",
      DROP COLUMN "siret_verified",
      DROP COLUMN "siret"
    `);
  }
}
