เพิ่มเหตุผลเกษียณ

This commit is contained in:
Kittapath 2024-05-27 08:58:44 +07:00
parent 38871bcc80
commit c2f71acad9
2 changed files with 23 additions and 0 deletions

View file

@ -159,6 +159,13 @@ export class Profile extends EntityBase {
})
isLeave: boolean;
@Column({
nullable: true,
comment: "เหตุผลเกษียณ",
default: null,
})
leaveReason: string;
@Column({
nullable: true,
type: "datetime",

View file

@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTableProfileAddLeaveReason1716649829280 implements MigrationInterface {
name = 'UpdateTableProfileAddLeaveReason1716649829280'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profile\` ADD \`leaveReason\` varchar(255) NULL COMMENT 'เหตุผลเกษียณ'`);
await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`leaveReason\` varchar(255) NULL COMMENT 'เหตุผลเกษียณ'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`leaveReason\``);
await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`leaveReason\``);
}
}