From bbf80788e0fc4aa1363f48cfaa4d2808cab53f0a Mon Sep 17 00:00:00 2001 From: Kittapath Date: Wed, 8 May 2024 16:44:55 +0700 Subject: [PATCH] migrate --- src/entities/kpiUserDevelopment.ts | 18 ++++++++++++++++++ src/entities/kpiUserEvaluation.ts | 6 ++++++ ...te_table_kpiUserEvaluation_add_isReqEdit.ts | 14 ++++++++++++++ ...e_table_kpiUserEvaluation_add_isReqEdit1.ts | 18 ++++++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 src/migration/1715161033009-update_table_kpiUserEvaluation_add_isReqEdit.ts create mode 100644 src/migration/1715161401755-update_table_kpiUserEvaluation_add_isReqEdit1.ts diff --git a/src/entities/kpiUserDevelopment.ts b/src/entities/kpiUserDevelopment.ts index 0843439..3650569 100644 --- a/src/entities/kpiUserDevelopment.ts +++ b/src/entities/kpiUserDevelopment.ts @@ -47,6 +47,24 @@ export class KpiUserDevelopment extends EntityBase { }) achievement0: string; + @Column({ + comment: "วิธีพัฒนา70", + default: false, + }) + isDevelopment70: boolean; + + @Column({ + comment: "วิธีพัฒนา20", + default: false, + }) + isDevelopment20: boolean; + + @Column({ + comment: "วิธีพัฒนา10", + default: false, + }) + isDevelopment10: boolean; + @Column({ nullable: true, length: 40, diff --git a/src/entities/kpiUserEvaluation.ts b/src/entities/kpiUserEvaluation.ts index f20e494..81ae81c 100644 --- a/src/entities/kpiUserEvaluation.ts +++ b/src/entities/kpiUserEvaluation.ts @@ -85,6 +85,12 @@ export class KpiUserEvaluation extends EntityBase { }) evaluationResults: string; + @Column({ + comment: "คำขอแก้ไข", + default: false, + }) + isReqEdit: boolean; + @Column({ type: "double", nullable: true, diff --git a/src/migration/1715161033009-update_table_kpiUserEvaluation_add_isReqEdit.ts b/src/migration/1715161033009-update_table_kpiUserEvaluation_add_isReqEdit.ts new file mode 100644 index 0000000..3941637 --- /dev/null +++ b/src/migration/1715161033009-update_table_kpiUserEvaluation_add_isReqEdit.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableKpiUserEvaluationAddIsReqEdit1715161033009 implements MigrationInterface { + name = 'UpdateTableKpiUserEvaluationAddIsReqEdit1715161033009' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`isReqEdit\` tinyint NOT NULL COMMENT 'คำขอแก้ไข' DEFAULT 0`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`isReqEdit\``); + } + +} diff --git a/src/migration/1715161401755-update_table_kpiUserEvaluation_add_isReqEdit1.ts b/src/migration/1715161401755-update_table_kpiUserEvaluation_add_isReqEdit1.ts new file mode 100644 index 0000000..799f614 --- /dev/null +++ b/src/migration/1715161401755-update_table_kpiUserEvaluation_add_isReqEdit1.ts @@ -0,0 +1,18 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableKpiUserEvaluationAddIsReqEdit11715161401755 implements MigrationInterface { + name = 'UpdateTableKpiUserEvaluationAddIsReqEdit11715161401755' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`kpiUserDevelopment\` ADD \`isDevelopment70\` tinyint NOT NULL COMMENT 'วิธีพัฒนา70' DEFAULT 0`); + await queryRunner.query(`ALTER TABLE \`kpiUserDevelopment\` ADD \`isDevelopment20\` tinyint NOT NULL COMMENT 'วิธีพัฒนา20' DEFAULT 0`); + await queryRunner.query(`ALTER TABLE \`kpiUserDevelopment\` ADD \`isDevelopment10\` tinyint NOT NULL COMMENT 'วิธีพัฒนา10' DEFAULT 0`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`kpiUserDevelopment\` DROP COLUMN \`isDevelopment10\``); + await queryRunner.query(`ALTER TABLE \`kpiUserDevelopment\` DROP COLUMN \`isDevelopment20\``); + await queryRunner.query(`ALTER TABLE \`kpiUserDevelopment\` DROP COLUMN \`isDevelopment70\``); + } + +}