From c5721faa70efa0c5cbfbf6e4f4ea642c7a4ca0fd Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 21 Mar 2024 22:59:39 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B9=88=E0=B8=AD?= =?UTF-8?q?=E0=B8=99=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94?= =?UTF-8?q?=E0=B8=B7=E0=B8=AD=E0=B8=99=E0=B8=A5=E0=B8=B9=E0=B8=81=E0=B8=88?= =?UTF-8?q?=E0=B9=89=E0=B8=B2=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OrganizationUnauthorizeController.ts | 1 + src/controllers/ProfileEmployeeController.ts | 1 + src/entities/ProfileEmployee.ts | 7 +++++++ ...014-update_table_profileemployee_add_group.ts | 16 ++++++++++++++++ 4 files changed, 25 insertions(+) create mode 100644 src/migration/1711033351014-update_table_profileemployee_add_group.ts diff --git a/src/controllers/OrganizationUnauthorizeController.ts b/src/controllers/OrganizationUnauthorizeController.ts index be8e1f49..782b8f5f 100644 --- a/src/controllers/OrganizationUnauthorizeController.ts +++ b/src/controllers/OrganizationUnauthorizeController.ts @@ -398,6 +398,7 @@ export class OrganizationUnauthorizeController extends Controller { ); return { salaryLevel: item.current_holder.salaryLevel, + group: item.current_holder.group, prefix: item.current_holder.prefix, firstName: item.current_holder.firstName, lastName: item.current_holder.lastName, diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index 94739200..bf312ee6 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -1003,6 +1003,7 @@ export class ProfileEmployeeController extends Controller { return { salaryLevel: item.current_holder.salaryLevel, + group: item.current_holder.group, prefix: item.current_holder.prefix, firstName: item.current_holder.firstName, lastName: item.current_holder.lastName, diff --git a/src/entities/ProfileEmployee.ts b/src/entities/ProfileEmployee.ts index 740237a3..d194e864 100644 --- a/src/entities/ProfileEmployee.ts +++ b/src/entities/ProfileEmployee.ts @@ -118,6 +118,13 @@ export class ProfileEmployee extends EntityBase { }) salaryLevel: number | null; + @Column({ + nullable: true, + comment: "กลุ่มบัญชีการจ้าง", + default: null, + }) + group: number; + @Column({ nullable: true, comment: "เชื้อชาติ", diff --git a/src/migration/1711033351014-update_table_profileemployee_add_group.ts b/src/migration/1711033351014-update_table_profileemployee_add_group.ts new file mode 100644 index 00000000..086f480f --- /dev/null +++ b/src/migration/1711033351014-update_table_profileemployee_add_group.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableProfileemployeeAddGroup1711033351014 implements MigrationInterface { + name = 'UpdateTableProfileemployeeAddGroup1711033351014' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`group\` int NULL COMMENT 'กลุ่มบัญชีการจ้าง'`); + await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`group\` int NULL COMMENT 'กลุ่มบัญชีการจ้าง'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`group\``); + await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`group\``); + } + +}