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\``); + } + +}