import { MigrationInterface, QueryRunner } from 'typeorm';

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

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

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`ALTER TABLE "items" DROP COLUMN "video_url"`);
    await queryRunner.query(
      `ALTER TABLE "items" ADD "video_url" character varying`,
    );
    await queryRunner.query(`DROP TABLE "item_queues"`);
  }
}
