migrate
This commit is contained in:
parent
21c72f2a1e
commit
f22cddbeee
3 changed files with 74 additions and 12 deletions
|
|
@ -61,6 +61,29 @@ export class KpiSpecial extends EntityBase {
|
||||||
})
|
})
|
||||||
summary: number;
|
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({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "ผลสำเร็จของงาน 1",
|
comment: "ผลสำเร็จของงาน 1",
|
||||||
|
|
@ -109,18 +132,6 @@ export class KpiSpecial extends EntityBase {
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
formula: string;
|
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 {
|
export class CreateKpiUserSpecial {
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,29 @@ export class KpiUserSpecial extends EntityBase {
|
||||||
})
|
})
|
||||||
summary: number;
|
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({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "ผลสำเร็จของงาน 1",
|
comment: "ผลสำเร็จของงาน 1",
|
||||||
|
|
|
||||||
|
|
@ -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`);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue