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\``); + } + +}