เพิ่มฟิว15% ทศนิยม
This commit is contained in:
parent
092d8e2e18
commit
02e824f8c4
2 changed files with 25 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
|
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany, Double } from "typeorm";
|
||||||
import { EntityBase } from "./base/Base";
|
import { EntityBase } from "./base/Base";
|
||||||
import { SalaryPeriod } from "./SalaryPeriod";
|
import { SalaryPeriod } from "./SalaryPeriod";
|
||||||
import { SalaryProfile } from "./SalaryProfile";
|
import { SalaryProfile } from "./SalaryProfile";
|
||||||
|
|
@ -28,10 +28,17 @@ export class SalaryOrg extends EntityBase {
|
||||||
total: number;
|
total: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
comment: "15%ของจำนวนคน",
|
comment: "15%ของจำนวนคน(จำนวนเต็ม)",
|
||||||
})
|
})
|
||||||
fifteenPercent: number;
|
fifteenPercent: number;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
comment: "15%ของจำนวนคน(จุดทศนิยม)",
|
||||||
|
type: "double",
|
||||||
|
default: 0,
|
||||||
|
})
|
||||||
|
fifteenPoint: Double;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
comment: "กลุ่ม GROUP1->กลุ่ม1 GROUP2->กลุ่ม2",
|
comment: "กลุ่ม GROUP1->กลุ่ม1 GROUP2->กลุ่ม2",
|
||||||
length: 10,
|
length: 10,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class UpdateTableSalaryPeriodAddFifteenPoint1709004502447 implements MigrationInterface {
|
||||||
|
name = 'UpdateTableSalaryPeriodAddFifteenPoint1709004502447'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`salaryOrg\` ADD \`fifteenPoint\` double NOT NULL COMMENT '15%ของจำนวนคน(จุดทศนิยม)' DEFAULT '0'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`salaryOrg\` CHANGE \`fifteenPercent\` \`fifteenPercent\` int NOT NULL COMMENT '15%ของจำนวนคน(จำนวนเต็ม)'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`salaryOrg\` CHANGE \`fifteenPercent\` \`fifteenPercent\` int NOT NULL COMMENT '15%ของจำนวนคน'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`salaryOrg\` DROP COLUMN \`fifteenPoint\``);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue