From c2f71acad92c1130468988b02a89a60795b218ec Mon Sep 17 00:00:00 2001 From: Kittapath Date: Mon, 27 May 2024 08:58:44 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B9=80=E0=B8=AB=E0=B8=95=E0=B8=B8=E0=B8=9C=E0=B8=A5=E0=B9=80?= =?UTF-8?q?=E0=B8=81=E0=B8=A9=E0=B8=B5=E0=B8=A2=E0=B8=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entities/Profile.ts | 7 +++++++ ...29280-update_table_profile_add_leaveReason.ts | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/migration/1716649829280-update_table_profile_add_leaveReason.ts diff --git a/src/entities/Profile.ts b/src/entities/Profile.ts index bfca8489..27bf80bc 100644 --- a/src/entities/Profile.ts +++ b/src/entities/Profile.ts @@ -159,6 +159,13 @@ export class Profile extends EntityBase { }) isLeave: boolean; + @Column({ + nullable: true, + comment: "เหตุผลเกษียณ", + default: null, + }) + leaveReason: string; + @Column({ nullable: true, type: "datetime", diff --git a/src/migration/1716649829280-update_table_profile_add_leaveReason.ts b/src/migration/1716649829280-update_table_profile_add_leaveReason.ts new file mode 100644 index 00000000..db8fd2da --- /dev/null +++ b/src/migration/1716649829280-update_table_profile_add_leaveReason.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableProfileAddLeaveReason1716649829280 implements MigrationInterface { + name = 'UpdateTableProfileAddLeaveReason1716649829280' + + public async up(queryRunner: QueryRunner): Promise { + 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 { + await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`leaveReason\``); + await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`leaveReason\``); + } + +}