From 97f1fc0a981608995b9d60457cdf233f30113706 Mon Sep 17 00:00:00 2001 From: Bright Date: Fri, 6 Dec 2024 12:39:46 +0700 Subject: [PATCH 1/3] 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\``); + } + +} From 35fb72e45d017c8da751fd66c0f4f6641e1c3f41 Mon Sep 17 00:00:00 2001 From: Bright Date: Fri, 6 Dec 2024 14:52:51 +0700 Subject: [PATCH 2/3] add fields --- src/entities/CommandRecive.ts | 8 +++++++ src/entities/Profile.ts | 8 +++++++ src/entities/ProfileEmployee.ts | 8 +++++++ ...256767-update_3table__add_amountSpecial.ts | 22 +++++++++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 src/migration/1733471256767-update_3table__add_amountSpecial.ts diff --git a/src/entities/CommandRecive.ts b/src/entities/CommandRecive.ts index 2e9c62d6..2ed7d823 100644 --- a/src/entities/CommandRecive.ts +++ b/src/entities/CommandRecive.ts @@ -67,6 +67,14 @@ export class CommandRecive extends EntityBase { }) amount: Double; + @Column({ + comment: "เงินพิเศษ", + default: 0, + nullable: true, + type: "double", + }) + amountSpecial: Double; + @Column({ comment: "เงินประจำตำแหน่ง", default: 0, diff --git a/src/entities/Profile.ts b/src/entities/Profile.ts index 06609028..d139d824 100644 --- a/src/entities/Profile.ts +++ b/src/entities/Profile.ts @@ -339,6 +339,14 @@ export class Profile extends EntityBase { }) amount: Double; + @Column({ + comment: "เงินพิเศษ", + default: 0, + nullable: true, + type: "double", + }) + amountSpecial: Double; + @Column({ comment: "เงินประจำตำแหน่ง", default: 0, diff --git a/src/entities/ProfileEmployee.ts b/src/entities/ProfileEmployee.ts index c492a457..4706f399 100644 --- a/src/entities/ProfileEmployee.ts +++ b/src/entities/ProfileEmployee.ts @@ -592,6 +592,14 @@ export class ProfileEmployee extends EntityBase { }) amount: Double; + @Column({ + comment: "เงินพิเศษ", + default: 0, + nullable: true, + type: "double", + }) + amountSpecial: Double; + @Column({ comment: "เงินประจำตำแหน่ง", default: 0, diff --git a/src/migration/1733471256767-update_3table__add_amountSpecial.ts b/src/migration/1733471256767-update_3table__add_amountSpecial.ts new file mode 100644 index 00000000..8c94690e --- /dev/null +++ b/src/migration/1733471256767-update_3table__add_amountSpecial.ts @@ -0,0 +1,22 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class Update3table_addAmountSpecial1733471256767 implements MigrationInterface { + name = 'Update3table_addAmountSpecial1733471256767' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`amountSpecial\` double NULL COMMENT 'เงินพิเศษ' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`amountSpecial\` double NULL COMMENT 'เงินพิเศษ' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`commandRecive\` ADD \`amountSpecial\` double NULL COMMENT 'เงินพิเศษ' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`profile\` ADD \`amountSpecial\` double NULL COMMENT 'เงินพิเศษ' DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`amountSpecial\` double NULL COMMENT 'เงินพิเศษ' DEFAULT '0'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`amountSpecial\``); + await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`amountSpecial\``); + await queryRunner.query(`ALTER TABLE \`commandRecive\` DROP COLUMN \`amountSpecial\``); + await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`amountSpecial\``); + await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`amountSpecial\``); + } + +} From 59d0e30192324ac38d26ba36743af5ea6cf63e22 Mon Sep 17 00:00:00 2001 From: Bright Date: Fri, 6 Dec 2024 17:57:19 +0700 Subject: [PATCH 3/3] add field commandType.isSalary --- src/entities/CommandType.ts | 6 ++++++ ...389096-update_table_commandType_add_isSalary.ts | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/migration/1733482389096-update_table_commandType_add_isSalary.ts diff --git a/src/entities/CommandType.ts b/src/entities/CommandType.ts index 86a34ba3..f3fb87fe 100644 --- a/src/entities/CommandType.ts +++ b/src/entities/CommandType.ts @@ -80,6 +80,12 @@ export class CommandType extends EntityBase { }) isAttachment: boolean; + @Column({ + comment: "สถานะแก้ไขเงินเดือน", + default: true, + }) + isSalary: boolean; + @Column({ nullable: true, comment: "คำอธิบาย", diff --git a/src/migration/1733482389096-update_table_commandType_add_isSalary.ts b/src/migration/1733482389096-update_table_commandType_add_isSalary.ts new file mode 100644 index 00000000..0ebc05fd --- /dev/null +++ b/src/migration/1733482389096-update_table_commandType_add_isSalary.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableCommandTypeAddIsSalary1733482389096 implements MigrationInterface { + name = 'UpdateTableCommandTypeAddIsSalary1733482389096' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`commandType\` ADD \`isSalary\` tinyint NOT NULL COMMENT 'สถานะแก้ไขเงินเดือน' DEFAULT 1`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`commandType\` DROP COLUMN \`isSalary\``); + } + +}