diff --git a/src/controllers/DevelopmentController.ts b/src/controllers/DevelopmentController.ts index cafa443..1e115b1 100644 --- a/src/controllers/DevelopmentController.ts +++ b/src/controllers/DevelopmentController.ts @@ -109,188 +109,7 @@ export class DevelopmentController extends Controller { " มีอยู่ในระบบแล้ว", ); } - let _null: any = null; const development = Object.assign(new Development(), requestBody); - switch (requestBody.strategyChildPlannedNode) { - case 1: { - const checkId = await this.strategyChild1Repository.findOne({ - where: { id: requestBody.strategyChildPlannedId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผนระดับ 1", - ); - } - development.strategyChild1PlannedId = checkId.id; - development.strategyChild2ActualId = _null; - development.strategyChild3ActualId = _null; - development.strategyChild4ActualId = _null; - development.strategyChild5ActualId = _null; - break; - } - case 2: { - const checkId = await this.strategyChild2Repository.findOne({ - where: { id: requestBody.strategyChildPlannedId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผนระดับ 2", - ); - } - development.strategyChild1PlannedId = checkId.strategyChild1Id; - development.strategyChild2PlannedId = checkId.id; - development.strategyChild3ActualId = _null; - development.strategyChild4ActualId = _null; - development.strategyChild5ActualId = _null; - break; - } - case 3: { - const checkId = await this.strategyChild3Repository.findOne({ - where: { id: requestBody.strategyChildPlannedId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผนระดับ 2", - ); - } - development.strategyChild1PlannedId = checkId.strategyChild1Id; - development.strategyChild2PlannedId = checkId.strategyChild2Id; - development.strategyChild3PlannedId = checkId.id; - development.strategyChild4ActualId = _null; - development.strategyChild5ActualId = _null; - break; - } - case 4: { - const checkId = await this.strategyChild4Repository.findOne({ - where: { id: requestBody.strategyChildPlannedId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผนระดับ 3", - ); - } - development.strategyChild1PlannedId = checkId.strategyChild1Id; - development.strategyChild2PlannedId = checkId.strategyChild2Id; - development.strategyChild3PlannedId = checkId.strategyChild3Id; - development.strategyChild4PlannedId = checkId.id; - development.strategyChild5ActualId = _null; - break; - } - case 5: { - const checkId = await this.strategyChild5Repository.findOne({ - where: { id: requestBody.strategyChildPlannedId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผนระดับ 2", - ); - } - development.strategyChild1PlannedId = checkId.strategyChild1Id; - development.strategyChild2PlannedId = checkId.strategyChild2Id; - development.strategyChild3PlannedId = checkId.strategyChild3Id; - development.strategyChild4PlannedId = checkId.strategyChild4Id; - development.strategyChild5PlannedId = checkId.id; - break; - } - - default: - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผน"); - } - switch (requestBody.strategyChildActualNode) { - case 1: { - const checkId = await this.strategyChild1Repository.findOne({ - where: { id: requestBody.strategyChildActualId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริงระดับ 1", - ); - } - development.strategyChild1ActualId = checkId.id; - development.strategyChild2ActualId = _null; - development.strategyChild3ActualId = _null; - development.strategyChild4ActualId = _null; - development.strategyChild5ActualId = _null; - break; - } - case 2: { - const checkId = await this.strategyChild2Repository.findOne({ - where: { id: requestBody.strategyChildActualId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริงระดับ 2", - ); - } - development.strategyChild1ActualId = checkId.strategyChild1Id; - development.strategyChild2ActualId = checkId.id; - development.strategyChild3ActualId = _null; - development.strategyChild4ActualId = _null; - development.strategyChild5ActualId = _null; - break; - } - case 3: { - const checkId = await this.strategyChild3Repository.findOne({ - where: { id: requestBody.strategyChildActualId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริงระดับ 3", - ); - } - development.strategyChild1ActualId = checkId.strategyChild1Id; - development.strategyChild2ActualId = checkId.strategyChild2Id; - development.strategyChild3ActualId = checkId.id; - development.strategyChild4ActualId = _null; - development.strategyChild5ActualId = _null; - break; - } - case 4: { - const checkId = await this.strategyChild4Repository.findOne({ - where: { id: requestBody.strategyChildActualId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริงระดับ 4", - ); - } - development.strategyChild1ActualId = checkId.strategyChild1Id; - development.strategyChild2ActualId = checkId.strategyChild2Id; - development.strategyChild3ActualId = checkId.strategyChild3Id; - development.strategyChild4ActualId = checkId.id; - development.strategyChild5ActualId = _null; - break; - } - case 5: { - const checkId = await this.strategyChild5Repository.findOne({ - where: { id: requestBody.strategyChildActualId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริงระดับ 5", - ); - } - development.strategyChild1ActualId = checkId.strategyChild1Id; - development.strategyChild2ActualId = checkId.strategyChild2Id; - development.strategyChild3ActualId = checkId.strategyChild3Id; - development.strategyChild4ActualId = checkId.strategyChild4Id; - development.strategyChild5ActualId = checkId.id; - break; - } - - default: - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริง"); - } development.createdUserId = request.user.sub; development.createdFullName = request.user.name; development.lastUpdateUserId = request.user.sub; @@ -335,187 +154,6 @@ export class DevelopmentController extends Controller { " มีอยู่ในระบบแล้ว", ); } - let _null: any = null; - switch (requestBody.strategyChildPlannedNode) { - case 1: { - const checkId = await this.strategyChild1Repository.findOne({ - where: { id: requestBody.strategyChildPlannedId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผนระดับ 1", - ); - } - development.strategyChild1PlannedId = checkId.id; - development.strategyChild2ActualId = _null; - development.strategyChild3ActualId = _null; - development.strategyChild4ActualId = _null; - development.strategyChild5ActualId = _null; - break; - } - case 2: { - const checkId = await this.strategyChild2Repository.findOne({ - where: { id: requestBody.strategyChildPlannedId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผนระดับ 2", - ); - } - development.strategyChild1PlannedId = checkId.strategyChild1Id; - development.strategyChild2PlannedId = checkId.id; - development.strategyChild3ActualId = _null; - development.strategyChild4ActualId = _null; - development.strategyChild5ActualId = _null; - break; - } - case 3: { - const checkId = await this.strategyChild3Repository.findOne({ - where: { id: requestBody.strategyChildPlannedId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผนระดับ 2", - ); - } - development.strategyChild1PlannedId = checkId.strategyChild1Id; - development.strategyChild2PlannedId = checkId.strategyChild2Id; - development.strategyChild3PlannedId = checkId.id; - development.strategyChild4ActualId = _null; - development.strategyChild5ActualId = _null; - break; - } - case 4: { - const checkId = await this.strategyChild4Repository.findOne({ - where: { id: requestBody.strategyChildPlannedId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผนระดับ 3", - ); - } - development.strategyChild1PlannedId = checkId.strategyChild1Id; - development.strategyChild2PlannedId = checkId.strategyChild2Id; - development.strategyChild3PlannedId = checkId.strategyChild3Id; - development.strategyChild4PlannedId = checkId.id; - development.strategyChild5ActualId = _null; - break; - } - case 5: { - const checkId = await this.strategyChild5Repository.findOne({ - where: { id: requestBody.strategyChildPlannedId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผนระดับ 2", - ); - } - development.strategyChild1PlannedId = checkId.strategyChild1Id; - development.strategyChild2PlannedId = checkId.strategyChild2Id; - development.strategyChild3PlannedId = checkId.strategyChild3Id; - development.strategyChild4PlannedId = checkId.strategyChild4Id; - development.strategyChild5PlannedId = checkId.id; - break; - } - - default: - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผน"); - } - switch (requestBody.strategyChildActualNode) { - case 1: { - const checkId = await this.strategyChild1Repository.findOne({ - where: { id: requestBody.strategyChildActualId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริงระดับ 1", - ); - } - development.strategyChild1ActualId = checkId.id; - development.strategyChild2ActualId = _null; - development.strategyChild3ActualId = _null; - development.strategyChild4ActualId = _null; - development.strategyChild5ActualId = _null; - break; - } - case 2: { - const checkId = await this.strategyChild2Repository.findOne({ - where: { id: requestBody.strategyChildActualId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริงระดับ 2", - ); - } - development.strategyChild1ActualId = checkId.strategyChild1Id; - development.strategyChild2ActualId = checkId.id; - development.strategyChild3ActualId = _null; - development.strategyChild4ActualId = _null; - development.strategyChild5ActualId = _null; - break; - } - case 3: { - const checkId = await this.strategyChild3Repository.findOne({ - where: { id: requestBody.strategyChildActualId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริงระดับ 3", - ); - } - development.strategyChild1ActualId = checkId.strategyChild1Id; - development.strategyChild2ActualId = checkId.strategyChild2Id; - development.strategyChild3ActualId = checkId.id; - development.strategyChild4ActualId = _null; - development.strategyChild5ActualId = _null; - break; - } - case 4: { - const checkId = await this.strategyChild4Repository.findOne({ - where: { id: requestBody.strategyChildActualId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริงระดับ 4", - ); - } - development.strategyChild1ActualId = checkId.strategyChild1Id; - development.strategyChild2ActualId = checkId.strategyChild2Id; - development.strategyChild3ActualId = checkId.strategyChild3Id; - development.strategyChild4ActualId = checkId.id; - development.strategyChild5ActualId = _null; - break; - } - case 5: { - const checkId = await this.strategyChild5Repository.findOne({ - where: { id: requestBody.strategyChildActualId }, - }); - if (!checkId) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริงระดับ 5", - ); - } - development.strategyChild1ActualId = checkId.strategyChild1Id; - development.strategyChild2ActualId = checkId.strategyChild2Id; - development.strategyChild3ActualId = checkId.strategyChild3Id; - development.strategyChild4ActualId = checkId.strategyChild4Id; - development.strategyChild5ActualId = checkId.id; - break; - } - - default: - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริง"); - } Object.assign(development, requestBody); development.lastUpdateUserId = request.user.sub; development.lastUpdateFullName = request.user.name; @@ -1000,6 +638,197 @@ export class DevelopmentController extends Controller { }), ); } + const _null: any = null; + if ( + requestBody.strategyChildPlannedNode != undefined && + requestBody.strategyChildPlannedNode != null + ) { + switch (requestBody.strategyChildPlannedNode) { + case 1: { + const checkId = await this.strategyChild1Repository.findOne({ + where: { id: requestBody.strategyChildPlannedId }, + }); + if (!checkId) { + throw new HttpError( + HttpStatusCode.NOT_FOUND, + "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผนระดับ 1", + ); + } + development.strategyChild1PlannedId = checkId.id; + development.strategyChild2ActualId = _null; + development.strategyChild3ActualId = _null; + development.strategyChild4ActualId = _null; + development.strategyChild5ActualId = _null; + break; + } + case 2: { + const checkId = await this.strategyChild2Repository.findOne({ + where: { id: requestBody.strategyChildPlannedId }, + }); + if (!checkId) { + throw new HttpError( + HttpStatusCode.NOT_FOUND, + "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผนระดับ 2", + ); + } + development.strategyChild1PlannedId = checkId.strategyChild1Id; + development.strategyChild2PlannedId = checkId.id; + development.strategyChild3ActualId = _null; + development.strategyChild4ActualId = _null; + development.strategyChild5ActualId = _null; + break; + } + case 3: { + const checkId = await this.strategyChild3Repository.findOne({ + where: { id: requestBody.strategyChildPlannedId }, + }); + if (!checkId) { + throw new HttpError( + HttpStatusCode.NOT_FOUND, + "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผนระดับ 2", + ); + } + development.strategyChild1PlannedId = checkId.strategyChild1Id; + development.strategyChild2PlannedId = checkId.strategyChild2Id; + development.strategyChild3PlannedId = checkId.id; + development.strategyChild4ActualId = _null; + development.strategyChild5ActualId = _null; + break; + } + case 4: { + const checkId = await this.strategyChild4Repository.findOne({ + where: { id: requestBody.strategyChildPlannedId }, + }); + if (!checkId) { + throw new HttpError( + HttpStatusCode.NOT_FOUND, + "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผนระดับ 3", + ); + } + development.strategyChild1PlannedId = checkId.strategyChild1Id; + development.strategyChild2PlannedId = checkId.strategyChild2Id; + development.strategyChild3PlannedId = checkId.strategyChild3Id; + development.strategyChild4PlannedId = checkId.id; + development.strategyChild5ActualId = _null; + break; + } + case 5: { + const checkId = await this.strategyChild5Repository.findOne({ + where: { id: requestBody.strategyChildPlannedId }, + }); + if (!checkId) { + throw new HttpError( + HttpStatusCode.NOT_FOUND, + "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผนระดับ 2", + ); + } + development.strategyChild1PlannedId = checkId.strategyChild1Id; + development.strategyChild2PlannedId = checkId.strategyChild2Id; + development.strategyChild3PlannedId = checkId.strategyChild3Id; + development.strategyChild4PlannedId = checkId.strategyChild4Id; + development.strategyChild5PlannedId = checkId.id; + break; + } + + default: + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามแผน"); + } + } + if ( + requestBody.strategyChildActualNode != undefined && + requestBody.strategyChildActualNode != null + ) { + switch (requestBody.strategyChildActualNode) { + case 1: { + const checkId = await this.strategyChild1Repository.findOne({ + where: { id: requestBody.strategyChildActualId }, + }); + if (!checkId) { + throw new HttpError( + HttpStatusCode.NOT_FOUND, + "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริงระดับ 1", + ); + } + development.strategyChild1ActualId = checkId.id; + development.strategyChild2ActualId = _null; + development.strategyChild3ActualId = _null; + development.strategyChild4ActualId = _null; + development.strategyChild5ActualId = _null; + break; + } + case 2: { + const checkId = await this.strategyChild2Repository.findOne({ + where: { id: requestBody.strategyChildActualId }, + }); + if (!checkId) { + throw new HttpError( + HttpStatusCode.NOT_FOUND, + "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริงระดับ 2", + ); + } + development.strategyChild1ActualId = checkId.strategyChild1Id; + development.strategyChild2ActualId = checkId.id; + development.strategyChild3ActualId = _null; + development.strategyChild4ActualId = _null; + development.strategyChild5ActualId = _null; + break; + } + case 3: { + const checkId = await this.strategyChild3Repository.findOne({ + where: { id: requestBody.strategyChildActualId }, + }); + if (!checkId) { + throw new HttpError( + HttpStatusCode.NOT_FOUND, + "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริงระดับ 3", + ); + } + development.strategyChild1ActualId = checkId.strategyChild1Id; + development.strategyChild2ActualId = checkId.strategyChild2Id; + development.strategyChild3ActualId = checkId.id; + development.strategyChild4ActualId = _null; + development.strategyChild5ActualId = _null; + break; + } + case 4: { + const checkId = await this.strategyChild4Repository.findOne({ + where: { id: requestBody.strategyChildActualId }, + }); + if (!checkId) { + throw new HttpError( + HttpStatusCode.NOT_FOUND, + "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริงระดับ 4", + ); + } + development.strategyChild1ActualId = checkId.strategyChild1Id; + development.strategyChild2ActualId = checkId.strategyChild2Id; + development.strategyChild3ActualId = checkId.strategyChild3Id; + development.strategyChild4ActualId = checkId.id; + development.strategyChild5ActualId = _null; + break; + } + case 5: { + const checkId = await this.strategyChild5Repository.findOne({ + where: { id: requestBody.strategyChildActualId }, + }); + if (!checkId) { + throw new HttpError( + HttpStatusCode.NOT_FOUND, + "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริงระดับ 5", + ); + } + development.strategyChild1ActualId = checkId.strategyChild1Id; + development.strategyChild2ActualId = checkId.strategyChild2Id; + development.strategyChild3ActualId = checkId.strategyChild3Id; + development.strategyChild4ActualId = checkId.strategyChild4Id; + development.strategyChild5ActualId = checkId.id; + break; + } + + default: + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลยุทธศาสตร์เป้าหมายตามจริง"); + } + } return new HttpSuccess(development.id); } @@ -1361,16 +1190,6 @@ export class DevelopmentController extends Controller { "rootId", "orgRootShortName", "orgRevisionId", - "strategyChild1Planned", - "strategyChild2Planned", - "strategyChild3Planned", - "strategyChild4Planned", - "strategyChild5Planned", - "strategyChild1Actual", - "strategyChild2Actual", - "strategyChild3Actual", - "strategyChild4Actual", - "strategyChild5Actual", ], }); if (!getDevelopment) { @@ -1456,6 +1275,7 @@ export class DevelopmentController extends Controller { .map((x) => ({ groupTarget: x.groupTarget, groupTargetSub: x.groupTargetSub, + type: x.type, position: x.plannedGoalPositions.map((y) => ({ position: y.position, posTypeId: y.posTypePlannedId, @@ -1509,6 +1329,16 @@ export class DevelopmentController extends Controller { developmentProjectTechniqueActuals: getDevelopment.developmentProjectTechniqueActuals .map((x) => x.name) .sort(), + strategyChild1Planned: getDevelopment.strategyChild1Planned, + strategyChild2Planned: getDevelopment.strategyChild2Planned, + strategyChild3Planned: getDevelopment.strategyChild3Planned, + strategyChild4Planned: getDevelopment.strategyChild4Planned, + strategyChild5Planned: getDevelopment.strategyChild5Planned, + strategyChild1Actual: getDevelopment.strategyChild1Actual, + strategyChild2Actual: getDevelopment.strategyChild2Actual, + strategyChild3Actual: getDevelopment.strategyChild3Actual, + strategyChild4Actual: getDevelopment.strategyChild4Actual, + strategyChild5Actual: getDevelopment.strategyChild5Actual, }; return new HttpSuccess(_getDevelopment); } diff --git a/src/entities/Development.ts b/src/entities/Development.ts index 1fcfc15..efafab1 100644 --- a/src/entities/Development.ts +++ b/src/entities/Development.ts @@ -538,14 +538,6 @@ export class CreateDevelopment { orgRootShortName: string; @Column() orgRevisionId: string; - @Column() - strategyChildPlannedId: string; - @Column() - strategyChildPlannedNode: number; - @Column() - strategyChildActualId: string; - @Column() - strategyChildActualNode: number; } export class UpdateDevelopment1 { @@ -617,6 +609,14 @@ export class UpdateDevelopment3 { projectNigthHoldActual?: number | null; @Column() developmentProjectTechniqueActuals?: string[]; + @Column() + strategyChildPlannedId?: string; + @Column() + strategyChildPlannedNode?: number; + @Column() + strategyChildActualId?: string; + @Column() + strategyChildActualNode?: number; } export class UpdateDevelopment4 { // @Column() diff --git a/src/entities/PlannedGoal.ts b/src/entities/PlannedGoal.ts index ec70ffe..4e070fb 100644 --- a/src/entities/PlannedGoal.ts +++ b/src/entities/PlannedGoal.ts @@ -48,12 +48,12 @@ export class PlannedGoal extends EntityBase { // @JoinColumn({ name: "posLevelPlannedId" }) // posLevelPlanned: PosLevel; - // @Column({ - // nullable: true, - // comment: "ประเภท(กลุ่มอาชีพ คุณสมบัติ)", - // default: null, - // }) - // type: string; + @Column({ + nullable: true, + comment: "ประเภท(กลุ่มอาชีพ คุณสมบัติ)", + default: null, + }) + type: string; @Column({ nullable: true, diff --git a/src/migration/1713341677475-update_table_devhis_add_type.ts b/src/migration/1713341677475-update_table_devhis_add_type.ts new file mode 100644 index 0000000..3446563 --- /dev/null +++ b/src/migration/1713341677475-update_table_devhis_add_type.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableDevhisAddType1713341677475 implements MigrationInterface { + name = 'UpdateTableDevhisAddType1713341677475' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`plannedGoal\` ADD \`type\` varchar(255) NULL COMMENT 'ประเภท(กลุ่มอาชีพ คุณสมบัติ)'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`plannedGoal\` DROP COLUMN \`type\``); + } + +}