From 7bf4310063d8fa9d1cfac3d53e9576bb95b77c54 Mon Sep 17 00:00:00 2001 From: kittapath Date: Tue, 4 Feb 2025 11:53:18 +0700 Subject: [PATCH] add year assessments --- src/entities/ProfileAssessment.ts | 9 +++++++++ ...1738644573688-updateProfileAssessmentAddYear.ts | 14 ++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/migration/1738644573688-updateProfileAssessmentAddYear.ts diff --git a/src/entities/ProfileAssessment.ts b/src/entities/ProfileAssessment.ts index 300f3c2c..6ae060ed 100644 --- a/src/entities/ProfileAssessment.ts +++ b/src/entities/ProfileAssessment.ts @@ -38,6 +38,12 @@ export class ProfileAssessment extends EntityBase { }) period: string; + @Column({ + comment: "ปีการประเมิน", + nullable: true, + }) + year: string; + @Column({ nullable: true, type: "datetime", @@ -113,6 +119,7 @@ export class CreateProfileAssessment { profileId: string | null; name: string | null; period: string | null; + year: number | null; date: Date | null; point1: number | null; point1Total: number | null; @@ -126,6 +133,7 @@ export class CreateProfileEmployeeAssessment { profileEmployeeId: string | null; name: string | null; period: string | null; + year: number | null; date: Date | null; point1: number | null; point1Total: number | null; @@ -138,6 +146,7 @@ export class CreateProfileEmployeeAssessment { export type UpdateProfileAssessment = { name?: string | null; period?: string | null; + year?: number | null; date?: Date | null; point1?: number | null; point1Total?: number | null; diff --git a/src/migration/1738644573688-updateProfileAssessmentAddYear.ts b/src/migration/1738644573688-updateProfileAssessmentAddYear.ts new file mode 100644 index 00000000..56b9bad3 --- /dev/null +++ b/src/migration/1738644573688-updateProfileAssessmentAddYear.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateProfileAssessmentAddYear1738644573688 implements MigrationInterface { + name = 'UpdateProfileAssessmentAddYear1738644573688' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileAssessment\` ADD \`year\` varchar(255) NULL COMMENT 'ปีการประเมิน'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileAssessment\` DROP COLUMN \`year\``); + } + +}