diff --git a/src/entities/ProfileEmployee.ts b/src/entities/ProfileEmployee.ts index 48809b88..39ebf088 100644 --- a/src/entities/ProfileEmployee.ts +++ b/src/entities/ProfileEmployee.ts @@ -1,4 +1,4 @@ -import { Entity, Column, OneToMany, ManyToOne } from "typeorm"; +import { Entity, Column, OneToMany, ManyToOne, Double } from "typeorm"; import { EntityBase } from "./base/Base"; import { EmployeePosLevel } from "./EmployeePosLevel"; import { EmployeePosType } from "./EmployeePosType"; @@ -568,6 +568,30 @@ export class ProfileEmployee extends EntityBase { }) employeeMoneyEmployer: string; + @Column({ + comment: "เงินเดือนฐาน", + default: 0, + nullable: true, + type: "double", + }) + amount: Double; + + @Column({ + comment: "เงินประจำตำแหน่ง", + default: 0, + nullable: true, + type: "double", + }) + positionSalaryAmount: Double; + + @Column({ + comment: "เงินค่าตอบแทนรายเดือน", + default: 0, + nullable: true, + type: "double", + }) + mouthSalaryAmount: Double; + @OneToMany(() => ProfileEmployeeInformationHistory, (v) => v.profileEmployeeInformation) information_histories: ProfileEmployeeInformationHistory[]; diff --git a/src/migration/1730774144012-updata_table_profile_add_salary1.ts b/src/migration/1730774144012-updata_table_profile_add_salary1.ts new file mode 100644 index 00000000..906d76d7 --- /dev/null +++ b/src/migration/1730774144012-updata_table_profile_add_salary1.ts @@ -0,0 +1,24 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdataTableProfileAddSalary11730774144012 implements MigrationInterface { + name = 'UpdataTableProfileAddSalary11730774144012' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`amount\` double NULL COMMENT 'เงินเดือนฐาน' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`positionSalaryAmount\` double NULL COMMENT 'เงินประจำตำแหน่ง' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`mouthSalaryAmount\` double NULL COMMENT 'เงินค่าตอบแทนรายเดือน' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`amount\` double NULL COMMENT 'เงินเดือนฐาน' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`positionSalaryAmount\` double NULL COMMENT 'เงินประจำตำแหน่ง' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`mouthSalaryAmount\` double NULL COMMENT 'เงินค่าตอบแทนรายเดือน' DEFAULT '0'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`mouthSalaryAmount\``); + await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`positionSalaryAmount\``); + await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`amount\``); + await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`mouthSalaryAmount\``); + await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`positionSalaryAmount\``); + await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`amount\``); + } + +}