diff --git a/src/entities/ProfileSalaryHistory.ts b/src/entities/ProfileSalaryHistory.ts index f8f9193d..f419c222 100644 --- a/src/entities/ProfileSalaryHistory.ts +++ b/src/entities/ProfileSalaryHistory.ts @@ -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; diff --git a/src/migration/1733798795372-update_table_add_field.ts b/src/migration/1733798795372-update_table_add_field.ts new file mode 100644 index 00000000..596c200c --- /dev/null +++ b/src/migration/1733798795372-update_table_add_field.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableAddField1733798795372 implements MigrationInterface { + name = 'UpdateTableAddField1733798795372' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileSalaryHistory\` ADD \`amountSpecial\` double NULL COMMENT 'เงินพิเศษ' DEFAULT '0'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileSalaryHistory\` DROP COLUMN \`amountSpecial\``); + } + +}