From 8050b53228d55076cb1d3326e63c6c0a5f4cb0e2 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Mon, 17 Jun 2024 13:43:01 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20type=20=E0=B8=9C?= =?UTF-8?q?=E0=B8=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entities/SalaryProfile.ts | 5 +++-- ...6807-update_table_salaryprofile_add_result.ts | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 src/migration/1718606376807-update_table_salaryprofile_add_result.ts diff --git a/src/entities/SalaryProfile.ts b/src/entities/SalaryProfile.ts index 10096a7..2783222 100644 --- a/src/entities/SalaryProfile.ts +++ b/src/entities/SalaryProfile.ts @@ -248,11 +248,12 @@ export class SalaryProfile extends EntityBase { child4: string; @Column({ + type: "double", nullable: true, - comment: "ผลการประเมินผลการปฏิบัติราชการ", default: null, + comment: "ผลการประเมินผลการปฏิบัติราชการ", }) - result: string; + result: number; @Column({ nullable: true, diff --git a/src/migration/1718606376807-update_table_salaryprofile_add_result.ts b/src/migration/1718606376807-update_table_salaryprofile_add_result.ts new file mode 100644 index 0000000..f5b4641 --- /dev/null +++ b/src/migration/1718606376807-update_table_salaryprofile_add_result.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableSalaryprofileAddResult1718606376807 implements MigrationInterface { + name = 'UpdateTableSalaryprofileAddResult1718606376807' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`result\``); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`result\` double NULL COMMENT 'ผลการประเมินผลการปฏิบัติราชการ'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`salaryProfile\` DROP COLUMN \`result\``); + await queryRunner.query(`ALTER TABLE \`salaryProfile\` ADD \`result\` varchar(255) NULL COMMENT 'ผลการประเมินผลการปฏิบัติราชการ'`); + } + +}