import { MigrationInterface, QueryRunner } from "typeorm";

export class UpdateCommandTypeAddIsAttachment1726736124344 implements MigrationInterface {
    name = 'UpdateCommandTypeAddIsAttachment1726736124344'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`commandType\` ADD \`isAttachment\` tinyint NOT NULL COMMENT 'สถานะบัญชีแนบท้าย' DEFAULT 1`);
        await queryRunner.query(`ALTER TABLE \`commandType\` ADD \`subtitle\` text NULL COMMENT 'คำอธิบาย'`);
        // await queryRunner.query(`ALTER TABLE \`HR_POSITION_OFFICER\` ADD \`FLAG_PERSON_TYPE\` text NULL`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        // await queryRunner.query(`ALTER TABLE \`HR_POSITION_OFFICER\` DROP COLUMN \`FLAG_PERSON_TYPE\``);
        await queryRunner.query(`ALTER TABLE \`commandType\` DROP COLUMN \`subtitle\``);
        await queryRunner.query(`ALTER TABLE \`commandType\` DROP COLUMN \`isAttachment\``);
    }

}
