import { MigrationInterface, QueryRunner } from "typeorm";

export class UpdateTablesTranningDevelopmentActPositionAddColumnIsDeleted1770110880489 implements MigrationInterface {
    name = 'UpdateTablesTranningDevelopmentActPositionAddColumnIsDeleted1770110880489'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`profileTraining\` ADD \`isDeleted\` tinyint NOT NULL COMMENT 'สถานะลบข้อมูลการฝึกอบรม/ดูงาน' DEFAULT 0`);
        await queryRunner.query(`ALTER TABLE \`profileDevelopment\` ADD \`isDeleted\` tinyint NOT NULL COMMENT 'สถานะลบข้อมูลการพัฒนารายบุคคล (Individual Development Plan)' DEFAULT 0`);
        await queryRunner.query(`ALTER TABLE \`profileActposition\` ADD \`isDeleted\` tinyint NOT NULL COMMENT 'สถานะลบข้อมูลรักษาการในตำแหน่ง' DEFAULT 0`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`profileActposition\` DROP COLUMN \`isDeleted\``);
        await queryRunner.query(`ALTER TABLE \`profileDevelopment\` DROP COLUMN \`isDeleted\``);
        await queryRunner.query(`ALTER TABLE \`profileTraining\` DROP COLUMN \`isDeleted\``);
    }

}
