From 35fb72e45d017c8da751fd66c0f4f6641e1c3f41 Mon Sep 17 00:00:00 2001 From: Bright Date: Fri, 6 Dec 2024 14:52:51 +0700 Subject: [PATCH] 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\``); + } + +}