import { MigrationInterface, QueryRunner } from 'typeorm';

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

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`ALTER TABLE "items" DROP COLUMN "sales_margin"`);
    await queryRunner.query(`ALTER TABLE "items" ADD "sales_margin" numeric`);
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`ALTER TABLE "items" DROP COLUMN "sales_margin"`);
    await queryRunner.query(`ALTER TABLE "items" ADD "sales_margin" integer`);
  }
}
