profileemp add amount

This commit is contained in:
kittapath 2024-11-05 09:37:44 +07:00
parent 1f7fa3160e
commit b5384b6d46
2 changed files with 49 additions and 1 deletions

View file

@ -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[];

View file

@ -0,0 +1,24 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdataTableProfileAddSalary11730774144012 implements MigrationInterface {
name = 'UpdataTableProfileAddSalary11730774144012'
public async up(queryRunner: QueryRunner): Promise<void> {
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<void> {
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\``);
}
}