import { MigrationInterface, QueryRunner } from "typeorm";

export class UpdateProfileDevelopment1727752118300 implements MigrationInterface {
    name = 'UpdateProfileDevelopment1727752118300'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` DROP COLUMN \`point\``);
        await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` DROP COLUMN \`summary\``);
        await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` DROP COLUMN \`target\``);
        await queryRunner.query(`ALTER TABLE \`profileDevelopment\` DROP COLUMN \`point\``);
        await queryRunner.query(`ALTER TABLE \`profileDevelopment\` DROP COLUMN \`summary\``);
        await queryRunner.query(`ALTER TABLE \`profileDevelopment\` DROP COLUMN \`target\``);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`profileDevelopment\` ADD \`target\` varchar(255) NULL COMMENT 'เป้าหมาย'`);
        await queryRunner.query(`ALTER TABLE \`profileDevelopment\` ADD \`summary\` double NULL COMMENT 'ผลการประเมิน'`);
        await queryRunner.query(`ALTER TABLE \`profileDevelopment\` ADD \`point\` int NULL COMMENT 'ระดับคะแนน'`);
        await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` ADD \`target\` varchar(255) NULL COMMENT 'เป้าหมาย'`);
        await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` ADD \`summary\` double NULL COMMENT 'ผลการประเมิน'`);
        await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` ADD \`point\` int NULL COMMENT 'ระดับคะแนน'`);
    }

}
