hrms-api-org/src/migration/1727081490162-update_command_add_isAttachment.ts
2024-09-23 16:16:59 +07:00

18 lines
1 KiB
TypeScript

import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateCommandAddIsAttachment1727081490162 implements MigrationInterface {
name = 'UpdateCommandAddIsAttachment1727081490162'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`commandSys\` ADD \`order\` int NULL COMMENT 'ลำดับแสดงผล'`);
await queryRunner.query(`ALTER TABLE \`command\` ADD \`isAttachment\` tinyint NOT NULL COMMENT 'สถานะบัญชีแนบท้าย' DEFAULT 1`);
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 \`command\` DROP COLUMN \`isAttachment\``);
await queryRunner.query(`ALTER TABLE \`commandSys\` DROP COLUMN \`order\``);
}
}