diff --git a/src/entities/ProfileAssessmentHistory.ts b/src/entities/ProfileAssessmentHistory.ts index 573a3946..224ea49c 100644 --- a/src/entities/ProfileAssessmentHistory.ts +++ b/src/entities/ProfileAssessmentHistory.ts @@ -18,6 +18,20 @@ export class ProfileAssessmentHistory extends EntityBase { }) name: string; + @Column({ + nullable: true, + comment: "รอบการประเมิน", + length: 255, + default: null, + }) + period: string; + + @Column({ + comment: "ปีการประเมิน", + nullable: true, + }) + year: string; + @Column({ nullable: true, type: "datetime", diff --git a/src/migration/1738645160671-updateProfileAssessmentAddYear1.ts b/src/migration/1738645160671-updateProfileAssessmentAddYear1.ts new file mode 100644 index 00000000..cff481e3 --- /dev/null +++ b/src/migration/1738645160671-updateProfileAssessmentAddYear1.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateProfileAssessmentAddYear11738645160671 implements MigrationInterface { + name = 'UpdateProfileAssessmentAddYear11738645160671' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileAssessmentHistory\` ADD \`period\` varchar(255) NULL COMMENT 'รอบการประเมิน'`); + await queryRunner.query(`ALTER TABLE \`profileAssessmentHistory\` ADD \`year\` varchar(255) NULL COMMENT 'ปีการประเมิน'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileAssessmentHistory\` DROP COLUMN \`year\``); + await queryRunner.query(`ALTER TABLE \`profileAssessmentHistory\` DROP COLUMN \`period\``); + } + +}