From 02002a32a61a14cde878ee3f003f47bc04b6cdfd Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Tue, 30 Jul 2024 11:33:46 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B8=9F=E0=B8=B4=E0=B8=A7=20isProfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/DevelopmentController.ts | 1 + src/entities/DevelopmentHistory.ts | 6 ++++++ ...1722313928787-update_table_migration07302024.ts | 14 ++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 src/migration/1722313928787-update_table_migration07302024.ts diff --git a/src/controllers/DevelopmentController.ts b/src/controllers/DevelopmentController.ts index 646237d..5a7f4bc 100644 --- a/src/controllers/DevelopmentController.ts +++ b/src/controllers/DevelopmentController.ts @@ -2027,6 +2027,7 @@ export class DevelopmentController extends Controller { dateStart: item.dateStart, dateEnd: item.dateEnd, isDone: item.isDone, + isProfile: item.isProfile, })); return new HttpSuccess(_getDevelopment); } diff --git a/src/entities/DevelopmentHistory.ts b/src/entities/DevelopmentHistory.ts index 12e9ee5..79c0719 100644 --- a/src/entities/DevelopmentHistory.ts +++ b/src/entities/DevelopmentHistory.ts @@ -215,6 +215,12 @@ export class DevelopmentHistory extends EntityBase { default: false, }) isDone: boolean; + + @Column({ + comment: "มีข้อมูลอยู่ในทะเบียนประวัติ", + default: false, + }) + isProfile: boolean; } export class CreateDevelopmentHistory { @Column() diff --git a/src/migration/1722313928787-update_table_migration07302024.ts b/src/migration/1722313928787-update_table_migration07302024.ts new file mode 100644 index 0000000..2b8fef8 --- /dev/null +++ b/src/migration/1722313928787-update_table_migration07302024.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableMigration073020241722313928787 implements MigrationInterface { + name = 'UpdateTableMigration073020241722313928787' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`developmentHistory\` ADD \`isProfile\` tinyint NOT NULL COMMENT 'มีข้อมูลอยู่ในทะเบียนประวัติ' DEFAULT 0`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`developmentHistory\` DROP COLUMN \`isProfile\``); + } + +}