import { MigrationInterface, QueryRunner } from "typeorm";

export class UpdataTableProfileAddSalary1730773461743 implements MigrationInterface {
    name = 'UpdataTableProfileAddSalary1730773461743'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`profile\` ADD \`amount\` double NULL COMMENT 'เงินเดือนฐาน' DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE \`profile\` ADD \`positionSalaryAmount\` double NULL COMMENT 'เงินประจำตำแหน่ง' DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE \`profile\` ADD \`mouthSalaryAmount\` double NULL COMMENT 'เงินค่าตอบแทนรายเดือน' DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`amount\` double NULL COMMENT 'เงินเดือนฐาน' DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`positionSalaryAmount\` double NULL COMMENT 'เงินประจำตำแหน่ง' DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`mouthSalaryAmount\` double NULL COMMENT 'เงินค่าตอบแทนรายเดือน' DEFAULT '0'`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`mouthSalaryAmount\``);
        await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`positionSalaryAmount\``);
        await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`amount\``);
        await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`mouthSalaryAmount\``);
        await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`positionSalaryAmount\``);
        await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`amount\``);
    }

}
