From 97f1fc0a981608995b9d60457cdf233f30113706 Mon Sep 17 00:00:00 2001 From: Bright Date: Fri, 6 Dec 2024 12:39:46 +0700 Subject: [PATCH] add profileSalary.amountSpecial --- src/entities/ProfileSalary.ts | 8 ++++++++ ...update_table_profileSalary_add_amountSpecial.ts | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/migration/1733463321778-update_table_profileSalary_add_amountSpecial.ts diff --git a/src/entities/ProfileSalary.ts b/src/entities/ProfileSalary.ts index c3e6adc7..47912f9f 100644 --- a/src/entities/ProfileSalary.ts +++ b/src/entities/ProfileSalary.ts @@ -95,6 +95,14 @@ export class ProfileSalary extends EntityBase { }) amount: Double; + @Column({ + comment: "เงินพิเศษ", + default: 0, + nullable: true, + type: "double", + }) + amountSpecial: Double; + @Column({ comment: "เงินประจำตำแหน่ง", default: 0, diff --git a/src/migration/1733463321778-update_table_profileSalary_add_amountSpecial.ts b/src/migration/1733463321778-update_table_profileSalary_add_amountSpecial.ts new file mode 100644 index 00000000..4cff7e82 --- /dev/null +++ b/src/migration/1733463321778-update_table_profileSalary_add_amountSpecial.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableProfileSalaryAddAmountSpecial1733463321778 implements MigrationInterface { + name = 'UpdateTableProfileSalaryAddAmountSpecial1733463321778' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileSalary\` ADD \`amountSpecial\` double NULL COMMENT 'เงินพิเศษ' DEFAULT '0'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileSalary\` DROP COLUMN \`amountSpecial\``); + } + +}