migration profileSalaryHistory

This commit is contained in:
Bright 2024-12-10 09:49:41 +07:00
parent da6c407678
commit d29a4a4747
2 changed files with 24 additions and 0 deletions

View file

@ -83,6 +83,14 @@ export class ProfileSalaryHistory extends EntityBase {
})
amount: Double;
@Column({
comment: "เงินพิเศษ",
default: 0,
nullable: true,
type: "double",
})
amountSpecial: Double;
@Column({
comment: "เงินประจำตำแหน่ง",
default: 0,
@ -149,6 +157,7 @@ export class CreateProfileSalaryHistory {
profileId: string;
date?: Date | null;
amount?: Double | null;
amountSpecial?: Double | null;
positionSalaryAmount?: Double | null;
mouthSalaryAmount?: Double | null;
posNo: string | null;
@ -165,6 +174,7 @@ export class CreateProfileSalaryHistory {
export class UpdateProfileSalaryHistory {
date?: Date | null;
amount?: Double | null;
amountSpecial?: Double | null;
positionSalaryAmount?: Double | null;
mouthSalaryAmount?: Double | null;
posNo?: string | null;

View file

@ -0,0 +1,14 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTableAddField1733798795372 implements MigrationInterface {
name = 'UpdateTableAddField1733798795372'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileSalaryHistory\` ADD \`amountSpecial\` double NULL COMMENT 'เงินพิเศษ' DEFAULT '0'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileSalaryHistory\` DROP COLUMN \`amountSpecial\``);
}
}