From 73cd6ba4ebd0b835f89980c35d23854b694e5b58 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Mon, 13 May 2024 10:43:12 +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=B8=9F=E0=B8=B4=E0=B8=A7=E0=B9=80=E0=B8=81=E0=B9=87=E0=B8=9A?= =?UTF-8?q?=E0=B8=A5=E0=B8=B9=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entities/ProfileEmployee.ts | 8 ++++++++ ...te_table_profileemployee_add_employeeClass.ts | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/migration/1715571667160-update_table_profileemployee_add_employeeClass.ts diff --git a/src/entities/ProfileEmployee.ts b/src/entities/ProfileEmployee.ts index 235fc81c..c971be08 100644 --- a/src/entities/ProfileEmployee.ts +++ b/src/entities/ProfileEmployee.ts @@ -8,6 +8,14 @@ import { ProfileDisciplineEmployee } from "./ProfileDisciplineEmployee"; @Entity("profileEmployee") export class ProfileEmployee extends EntityBase { + @Column({ + nullable: true, + comment: "ประเภทลูกจ้าง (perm->ลูกจ้างประจำ temp->ลูกจ้างชั่วคราว)", + length: 40, + default: null, + }) + employeeClass: string; + @Column({ nullable: true, comment: "ยศ", diff --git a/src/migration/1715571667160-update_table_profileemployee_add_employeeClass.ts b/src/migration/1715571667160-update_table_profileemployee_add_employeeClass.ts new file mode 100644 index 00000000..e3cc6323 --- /dev/null +++ b/src/migration/1715571667160-update_table_profileemployee_add_employeeClass.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableProfileemployeeAddEmployeeClass1715571667160 implements MigrationInterface { + name = 'UpdateTableProfileemployeeAddEmployeeClass1715571667160' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`employeeClass\` varchar(40) NULL COMMENT 'ประเภทลูกจ้าง (perm->ลูกจ้างประจำ temp->ลูกจ้างชั่วคราว)'`); + await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`employeeClass\` varchar(40) NULL COMMENT 'ประเภทลูกจ้าง (perm->ลูกจ้างประจำ temp->ลูกจ้างชั่วคราว)'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`employeeClass\``); + await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`employeeClass\``); + } + +}