add fields

This commit is contained in:
Bright 2024-12-06 14:52:51 +07:00
parent 97f1fc0a98
commit 35fb72e45d
4 changed files with 46 additions and 0 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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,

View file

@ -0,0 +1,22 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class Update3table_addAmountSpecial1733471256767 implements MigrationInterface {
name = 'Update3table_addAmountSpecial1733471256767'
public async up(queryRunner: QueryRunner): Promise<void> {
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<void> {
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\``);
}
}