import { MigrationInterface, QueryRunner } from "typeorm";

export class ModifyReportAnswerJson1747842363727 implements MigrationInterface {
    name = 'ModifyReportAnswerJson1747842363727'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`question_responses\` DROP COLUMN \`answer\``);
        await queryRunner.query(`ALTER TABLE \`question_responses\` ADD \`answer\` text NOT NULL`);
        await queryRunner.query(`ALTER TABLE \`monitored_websites\` CHANGE \`priority\` \`priority\` int(1) NOT NULL COMMENT 'Priority level (1=highest, 5=lowest)'`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`monitored_websites\` CHANGE \`priority\` \`priority\` int NOT NULL COMMENT 'Priority level (1=highest, 5=lowest)'`);
        await queryRunner.query(`ALTER TABLE \`question_responses\` DROP COLUMN \`answer\``);
        await queryRunner.query(`ALTER TABLE \`question_responses\` ADD \`answer\` varchar(255) NOT NULL`);
    }

}
