diff --git a/src/entities/ProfileChangePosition.ts b/src/entities/ProfileChangePosition.ts index 575f1cd6..7adff5b8 100644 --- a/src/entities/ProfileChangePosition.ts +++ b/src/entities/ProfileChangePosition.ts @@ -31,6 +31,8 @@ export class ProfileChangePosition extends EntityBase { @Column({ nullable: true, comment: "ข้อมูลหน่วยงานเดิม เงินเดือน", type: "double", default: null }) amountOld: number; + @Column({ nullable: true, type: "datetime", comment: "ดำรงตำแหน่งในระดับปัจจุบันเมื่อ", default: null }) + dateCurrent: Date @Column({ nullable: true, comment: "profile Id", default: null }) profileId: string; @@ -255,7 +257,7 @@ export type UpdateProfileChangePosition = { positionLevelOld: string; positionNumberOld: string; amountOld: number; - dateCurrent : Date | null + dateCurrent : Date; reason: string | null; }; diff --git a/src/migration/1718248767175-update_table_profilechange_add_current.ts b/src/migration/1718248767175-update_table_profilechange_add_current.ts new file mode 100644 index 00000000..05b38d4a --- /dev/null +++ b/src/migration/1718248767175-update_table_profilechange_add_current.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableProfilechangeAddCurrent1718248767175 implements MigrationInterface { + name = 'UpdateTableProfilechangeAddCurrent1718248767175' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileChangePosition\` ADD \`dateCurrent\` datetime NULL COMMENT 'ดำรงตำแหน่งในระดับปัจจุบันเมื่อ'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`profileChangePosition\` DROP COLUMN \`dateCurrent\``); + } + +}