diff --git a/src/entities/SalaryProfile.ts b/src/entities/SalaryProfile.ts index b25a337..10096a7 100644 --- a/src/entities/SalaryProfile.ts +++ b/src/entities/SalaryProfile.ts @@ -18,6 +18,14 @@ export class SalaryProfile extends EntityBase { }) profileId: string; + @Column({ + nullable: true, + comment: "ยศ", + length: 255, + default: null, + }) + rank: string; + @Column({ nullable: true, comment: "คำนำหน้า", @@ -324,6 +332,9 @@ export class CreateSalaryProfile { @Column() profileId: string; + @Column() + rank?: string | null; + @Column() prefix: string; diff --git a/src/entities/SalaryProfileEmployee.ts b/src/entities/SalaryProfileEmployee.ts index ef32fc8..d9657bc 100644 --- a/src/entities/SalaryProfileEmployee.ts +++ b/src/entities/SalaryProfileEmployee.ts @@ -34,6 +34,14 @@ export class SalaryProfileEmployee extends EntityBase { }) profileId: string; + @Column({ + nullable: true, + comment: "ยศ", + length: 255, + default: null, + }) + rank: string; + @Column({ nullable: true, comment: "คำนำหน้า", @@ -376,6 +384,9 @@ export class CreateSalaryProfileEmployee { @Column() profileId: string; + @Column() + rank?: string | null; + @Column() prefix: string; @@ -407,7 +418,7 @@ export class CreateSalaryProfileEmployee { posType: string | null; @Column() - posLevel: string | null; + posLevel: number | null; @Column() group: number | null; diff --git a/src/migration/1716881317736-update_table_salaryProfile_add_rank.ts b/src/migration/1716881317736-update_table_salaryProfile_add_rank.ts new file mode 100644 index 0000000..70b1ff4 --- /dev/null +++ b/src/migration/1716881317736-update_table_salaryProfile_add_rank.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableSalaryProfileAddRank1716881317736 implements MigrationInterface { + name = 'UpdateTableSalaryProfileAddRank1716881317736' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`rank\` varchar(255) NULL COMMENT 'ยศ'`); + await queryRunner.query(`ALTER TABLE \`salaryProfileEmployee\` ADD \`rank\` varchar(255) NULL COMMENT 'ยศ'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`salaryProfileEmployee\` DROP COLUMN \`rank\``); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`rank\``); + } + +}