From e208b1ef1b4117356dc35547c80d5550ab944c4c Mon Sep 17 00:00:00 2001 From: kittapath Date: Tue, 4 Feb 2025 11:45:16 +0700 Subject: [PATCH] add period at ProfileAssessment --- src/entities/ProfileAssessment.ts | 11 +++++++++++ ...644026886-updateProfileAssessmentAddperiod.ts | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/migration/1738644026886-updateProfileAssessmentAddperiod.ts diff --git a/src/entities/ProfileAssessment.ts b/src/entities/ProfileAssessment.ts index 77e1ba3d..300f3c2c 100644 --- a/src/entities/ProfileAssessment.ts +++ b/src/entities/ProfileAssessment.ts @@ -30,6 +30,14 @@ export class ProfileAssessment extends EntityBase { }) name: string; + @Column({ + nullable: true, + comment: "รอบการประเมิน", + length: 255, + default: null, + }) + period: string; + @Column({ nullable: true, type: "datetime", @@ -104,6 +112,7 @@ export class ProfileAssessment extends EntityBase { export class CreateProfileAssessment { profileId: string | null; name: string | null; + period: string | null; date: Date | null; point1: number | null; point1Total: number | null; @@ -116,6 +125,7 @@ export class CreateProfileAssessment { export class CreateProfileEmployeeAssessment { profileEmployeeId: string | null; name: string | null; + period: string | null; date: Date | null; point1: number | null; point1Total: number | null; @@ -127,6 +137,7 @@ export class CreateProfileEmployeeAssessment { export type UpdateProfileAssessment = { name?: string | null; + period?: string | null; date?: Date | null; point1?: number | null; point1Total?: number | null; diff --git a/src/migration/1738644026886-updateProfileAssessmentAddperiod.ts b/src/migration/1738644026886-updateProfileAssessmentAddperiod.ts new file mode 100644 index 00000000..cf65ddde --- /dev/null +++ b/src/migration/1738644026886-updateProfileAssessmentAddperiod.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateProfileAssessmentAddperiod1738644026886 implements MigrationInterface { + name = 'UpdateProfileAssessmentAddperiod1738644026886' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`CREATE TABLE \`IMPORT_ORG\` (\`id\` int NOT NULL AUTO_INCREMENT, \`DEPARTMENT_CODE\` text NULL, \`DIVISION_CODE\` text NULL, \`SECTION_CODE\` text NULL, \`JOB_CODE\` text NULL, \`orgRoot\` text NULL, \`orgChild1\` text NULL, \`orgChild2\` text NULL, \`orgChild3\` text NULL, \`MISCODE\` text NULL, PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); + await queryRunner.query(`ALTER TABLE \`profileAssessment\` ADD \`period\` varchar(255) NULL COMMENT 'รอบการประเมิน'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileAssessment\` DROP COLUMN \`period\``); + await queryRunner.query(`DROP TABLE \`IMPORT_ORG\``); + } + +}