From 2a7a5d592204371007d6ab35824505a90788aca1 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Tue, 27 Feb 2024 12:56: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=B8=9F=E0=B8=B4=E0=B8=A7=20isResult?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entities/SalaryProfile.ts | 30 +++++++++++++++++++ ...update_table_salaryProfile_add_isresult.ts | 22 ++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 src/migration/1709013351821-update_table_salaryProfile_add_isresult.ts diff --git a/src/entities/SalaryProfile.ts b/src/entities/SalaryProfile.ts index fcd764e..04f3d56 100644 --- a/src/entities/SalaryProfile.ts +++ b/src/entities/SalaryProfile.ts @@ -216,6 +216,36 @@ export class SalaryProfile extends EntityBase { }) child4: string; + @Column({ + comment: "ผลการประเมิน", + default: false, + }) + isResult: boolean; + + @Column({ + comment: "ระยะเวลา", + default: false, + }) + isDuration: boolean; + + @Column({ + comment: "การลงโทษ", + default: false, + }) + isPunish: boolean; + + @Column({ + comment: "พักราชการ", + default: false, + }) + isRetired: boolean; + + @Column({ + comment: "ขาดราชการ", + default: false, + }) + isRetired2: boolean; + @ManyToOne(() => SalaryOrg, (salaryOrg) => salaryOrg.salaryProfiles) @JoinColumn({ name: "salaryOrgId" }) salaryOrg: SalaryOrg; diff --git a/src/migration/1709013351821-update_table_salaryProfile_add_isresult.ts b/src/migration/1709013351821-update_table_salaryProfile_add_isresult.ts new file mode 100644 index 0000000..a724663 --- /dev/null +++ b/src/migration/1709013351821-update_table_salaryProfile_add_isresult.ts @@ -0,0 +1,22 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableSalaryProfileAddIsresult1709013351821 implements MigrationInterface { + name = 'UpdateTableSalaryProfileAddIsresult1709013351821' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`isResult\` tinyint NOT NULL COMMENT 'ผลการประเมิน' DEFAULT 0`); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`isDuration\` tinyint NOT NULL COMMENT 'ระยะเวลา' DEFAULT 0`); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`isPunish\` tinyint NOT NULL COMMENT 'การลงโทษ' DEFAULT 0`); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`isRetired\` tinyint NOT NULL COMMENT 'พักราชการ' DEFAULT 0`); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`isRetired2\` tinyint NOT NULL COMMENT 'ขาดราชการ' DEFAULT 0`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`isRetired2\``); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`isRetired\``); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`isPunish\``); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`isDuration\``); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`isResult\``); + } + +}