This commit is contained in:
Kittapath 2024-05-08 10:22:51 +07:00
parent 21c72f2a1e
commit f22cddbeee
3 changed files with 74 additions and 12 deletions

View file

@ -61,6 +61,29 @@ export class KpiSpecial extends EntityBase {
})
summary: number;
@Column({
nullable: true,
comment: "ข้อมูลเอกสารหลักฐาน",
default: null,
})
documentInfoEvidence: string;
@Column({
nullable: true,
type: "datetime",
comment: "ช่วงเวลาเริ่มเก็บข้อมูล",
default: null,
})
startDate: Date;
@Column({
nullable: true,
type: "datetime",
comment: "ช่วงเวลาสิ้นสุดเก็บข้อมูล",
default: null,
})
endDate: Date;
@Column({
nullable: true,
comment: "ผลสำเร็จของงาน 1",
@ -109,18 +132,6 @@ export class KpiSpecial extends EntityBase {
default: null,
})
formula: string;
@Column({
nullable: true,
length: 40,
comment: "คีย์นอก(FK)ของตาราง kpiUserEvaluation",
default: null,
})
kpiUserEvaluationId: string;
@ManyToOne(() => KpiUserEvaluation, (kpiUserEvaluation) => kpiUserEvaluation.kpiUserSpecials)
@JoinColumn({ name: "kpiUserEvaluationId" })
kpiUserEvaluation: KpiUserEvaluation;
}
export class CreateKpiUserSpecial {

View file

@ -61,6 +61,29 @@ export class KpiUserSpecial extends EntityBase {
})
summary: number;
@Column({
nullable: true,
comment: "ข้อมูลเอกสารหลักฐาน",
default: null,
})
documentInfoEvidence: string;
@Column({
nullable: true,
type: "datetime",
comment: "ช่วงเวลาเริ่มเก็บข้อมูล",
default: null,
})
startDate: Date;
@Column({
nullable: true,
type: "datetime",
comment: "ช่วงเวลาสิ้นสุดเก็บข้อมูล",
default: null,
})
endDate: Date;
@Column({
nullable: true,
comment: "ผลสำเร็จของงาน 1",

View file

@ -0,0 +1,28 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTableKpiPlanAddAchievement21715138466608 implements MigrationInterface {
name = 'UpdateTableKpiPlanAddAchievement21715138466608'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`kpiSpecial\` DROP FOREIGN KEY \`FK_10065ab86a67156f5dc6731f79e\``);
await queryRunner.query(`ALTER TABLE \`kpiSpecial\` DROP COLUMN \`kpiUserEvaluationId\``);
await queryRunner.query(`ALTER TABLE \`kpiUserSpecial\` ADD \`documentInfoEvidence\` varchar(255) NULL COMMENT 'ข้อมูลเอกสารหลักฐาน'`);
await queryRunner.query(`ALTER TABLE \`kpiUserSpecial\` ADD \`startDate\` datetime NULL COMMENT 'ช่วงเวลาเริ่มเก็บข้อมูล'`);
await queryRunner.query(`ALTER TABLE \`kpiUserSpecial\` ADD \`endDate\` datetime NULL COMMENT 'ช่วงเวลาสิ้นสุดเก็บข้อมูล'`);
await queryRunner.query(`ALTER TABLE \`kpiSpecial\` ADD \`documentInfoEvidence\` varchar(255) NULL COMMENT 'ข้อมูลเอกสารหลักฐาน'`);
await queryRunner.query(`ALTER TABLE \`kpiSpecial\` ADD \`startDate\` datetime NULL COMMENT 'ช่วงเวลาเริ่มเก็บข้อมูล'`);
await queryRunner.query(`ALTER TABLE \`kpiSpecial\` ADD \`endDate\` datetime NULL COMMENT 'ช่วงเวลาสิ้นสุดเก็บข้อมูล'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`kpiSpecial\` DROP COLUMN \`endDate\``);
await queryRunner.query(`ALTER TABLE \`kpiSpecial\` DROP COLUMN \`startDate\``);
await queryRunner.query(`ALTER TABLE \`kpiSpecial\` DROP COLUMN \`documentInfoEvidence\``);
await queryRunner.query(`ALTER TABLE \`kpiUserSpecial\` DROP COLUMN \`endDate\``);
await queryRunner.query(`ALTER TABLE \`kpiUserSpecial\` DROP COLUMN \`startDate\``);
await queryRunner.query(`ALTER TABLE \`kpiUserSpecial\` DROP COLUMN \`documentInfoEvidence\``);
await queryRunner.query(`ALTER TABLE \`kpiSpecial\` ADD \`kpiUserEvaluationId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง kpiUserEvaluation'`);
await queryRunner.query(`ALTER TABLE \`kpiSpecial\` ADD CONSTRAINT \`FK_10065ab86a67156f5dc6731f79e\` FOREIGN KEY (\`kpiUserEvaluationId\`) REFERENCES \`kpiUserEvaluation\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
}
}