From 5643cc67c4a65d130395eca51849b48a2d329452 Mon Sep 17 00:00:00 2001 From: kittapath Date: Tue, 1 Oct 2024 10:30:03 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=9F=E0=B8=B4?= =?UTF-8?q?=E0=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entities/ProfileDevelopment.ts | 65 +++++++++++-------- src/entities/ProfileDevelopmentHistory.ts | 38 +++++------ ...1727752118300-update_ProfileDevelopment.ts | 24 +++++++ 3 files changed, 80 insertions(+), 47 deletions(-) create mode 100644 src/migration/1727752118300-update_ProfileDevelopment.ts diff --git a/src/entities/ProfileDevelopment.ts b/src/entities/ProfileDevelopment.ts index 40375bda..73b5d6f5 100644 --- a/src/entities/ProfileDevelopment.ts +++ b/src/entities/ProfileDevelopment.ts @@ -40,27 +40,27 @@ export class ProfileDevelopment extends EntityBase { }) name: string; - @Column({ - nullable: true, - comment: "เป้าหมาย", - default: null, - }) - target: string; + // @Column({ + // nullable: true, + // comment: "เป้าหมาย", + // default: null, + // }) + // target: string; - @Column({ - type: "double", - nullable: true, - default: null, - comment: "ผลการประเมิน", - }) - summary: number; + // @Column({ + // type: "double", + // nullable: true, + // default: null, + // comment: "ผลการประเมิน", + // }) + // summary: number; - @Column({ - nullable: true, - comment: "ระดับคะแนน", - default: null, - }) - point: number; + // @Column({ + // nullable: true, + // comment: "ระดับคะแนน", + // default: null, + // }) + // point: number; @Column({ nullable: true, @@ -179,7 +179,7 @@ export class CreateProfileDevelopment { type?: string | null; profileId: string | null; name: string | null; - target: string | null; + // target: string | null; achievement10?: string | null; achievement5?: string | null; achievement0?: string | null; @@ -190,8 +190,11 @@ export class CreateProfileDevelopment { isDevelopment70: boolean | null; isDevelopment20: boolean | null; isDevelopment10: boolean | null; - summary?: number | null; - point?: number | null; + // summary?: number | null; + // point?: number | null; + developmentTarget?: number | null; + developmentResults?: number | null; + developmentReport?: number | null; developmentProjects?: string[]; } @@ -199,7 +202,7 @@ export class CreateProfileEmployeeDevelopment { type?: string | null; profileEmployeeId: string | null; name: string | null; - target: string | null; + // target: string | null; achievement10?: string | null; achievement5?: string | null; achievement0?: string | null; @@ -210,15 +213,18 @@ export class CreateProfileEmployeeDevelopment { isDevelopment70: boolean | null; isDevelopment20: boolean | null; isDevelopment10: boolean | null; - summary?: number | null; - point?: number | null; + // summary?: number | null; + // point?: number | null; + developmentTarget?: number | null; + developmentResults?: number | null; + developmentReport?: number | null; developmentProjects?: string[]; } export type UpdateProfileDevelopment = { type?: string | null; name: string | null; - target: string | null; + // target: string | null; achievement10?: string | null; achievement5?: string | null; achievement0?: string | null; @@ -229,7 +235,10 @@ export type UpdateProfileDevelopment = { isDevelopment70: boolean | null; isDevelopment20: boolean | null; isDevelopment10: boolean | null; - summary?: number | null; - point?: number | null; + // summary?: number | null; + // point?: number | null; + developmentTarget?: number | null; + developmentResults?: number | null; + developmentReport?: number | null; developmentProjects?: string[]; }; diff --git a/src/entities/ProfileDevelopmentHistory.ts b/src/entities/ProfileDevelopmentHistory.ts index 5e45c93d..ca169532 100644 --- a/src/entities/ProfileDevelopmentHistory.ts +++ b/src/entities/ProfileDevelopmentHistory.ts @@ -22,27 +22,27 @@ export class ProfileDevelopmentHistory extends EntityBase { }) name: string; - @Column({ - nullable: true, - comment: "เป้าหมาย", - default: null, - }) - target: string; + // @Column({ + // nullable: true, + // comment: "เป้าหมาย", + // default: null, + // }) + // target: string; - @Column({ - type: "double", - nullable: true, - default: null, - comment: "ผลการประเมิน", - }) - summary: number; + // @Column({ + // type: "double", + // nullable: true, + // default: null, + // comment: "ผลการประเมิน", + // }) + // summary: number; - @Column({ - nullable: true, - comment: "ระดับคะแนน", - default: null, - }) - point: number; + // @Column({ + // nullable: true, + // comment: "ระดับคะแนน", + // default: null, + // }) + // point: number; @Column({ nullable: true, diff --git a/src/migration/1727752118300-update_ProfileDevelopment.ts b/src/migration/1727752118300-update_ProfileDevelopment.ts new file mode 100644 index 00000000..95959d39 --- /dev/null +++ b/src/migration/1727752118300-update_ProfileDevelopment.ts @@ -0,0 +1,24 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateProfileDevelopment1727752118300 implements MigrationInterface { + name = 'UpdateProfileDevelopment1727752118300' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` DROP COLUMN \`point\``); + await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` DROP COLUMN \`summary\``); + await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` DROP COLUMN \`target\``); + await queryRunner.query(`ALTER TABLE \`profileDevelopment\` DROP COLUMN \`point\``); + await queryRunner.query(`ALTER TABLE \`profileDevelopment\` DROP COLUMN \`summary\``); + await queryRunner.query(`ALTER TABLE \`profileDevelopment\` DROP COLUMN \`target\``); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileDevelopment\` ADD \`target\` varchar(255) NULL COMMENT 'เป้าหมาย'`); + await queryRunner.query(`ALTER TABLE \`profileDevelopment\` ADD \`summary\` double NULL COMMENT 'ผลการประเมิน'`); + await queryRunner.query(`ALTER TABLE \`profileDevelopment\` ADD \`point\` int NULL COMMENT 'ระดับคะแนน'`); + await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` ADD \`target\` varchar(255) NULL COMMENT 'เป้าหมาย'`); + await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` ADD \`summary\` double NULL COMMENT 'ผลการประเมิน'`); + await queryRunner.query(`ALTER TABLE \`profileDevelopmentHistory\` ADD \`point\` int NULL COMMENT 'ระดับคะแนน'`); + } + +}