diff --git a/src/controllers/DevelopmentScholarshipController.ts b/src/controllers/DevelopmentScholarshipController.ts index 54bead1..d3df7e8 100644 --- a/src/controllers/DevelopmentScholarshipController.ts +++ b/src/controllers/DevelopmentScholarshipController.ts @@ -519,6 +519,7 @@ export class DevelopmentScholarshipController extends Controller { profileId: getDevelopment.profileId ? getDevelopment.profileId : null, planType: getDevelopment.planType ? getDevelopment.planType : null, isNoUseBudget: getDevelopment.isNoUseBudget ? getDevelopment.isNoUseBudget : null, + budgetSourceOther: getDevelopment.budgetSourceOther ? getDevelopment.budgetSourceOther : null, }; return new HttpSuccess(formattedData); } diff --git a/src/entities/DevelopmentScholarship.ts b/src/entities/DevelopmentScholarship.ts index c0ef3cf..976598e 100644 --- a/src/entities/DevelopmentScholarship.ts +++ b/src/entities/DevelopmentScholarship.ts @@ -573,7 +573,7 @@ export class DevelopmentScholarship extends EntityBase { comment: "เงินอื่นๆ", default: null, }) - budgetSourceOther: number; + budgetSourceOther: string; } export class CreateDevelopmentScholarship { rootId: string | null; @@ -638,7 +638,7 @@ export class CreateDevelopmentScholarship { totalPeriod: string | null; planType: string | null; isNoUseBudget: boolean | null; - budgetSourceOther?: number | null; + budgetSourceOther?: string | null; } export class UpdateDevelopmentScholarship { @@ -704,7 +704,7 @@ export class UpdateDevelopmentScholarship { totalPeriod: string | null; planType: string | null; isNoUseBudget: boolean | null; - budgetSourceOther?: number | null; + budgetSourceOther?: string | null; } export class UpdateDevelopmentScholarshipUser { @@ -715,5 +715,5 @@ export class UpdateDevelopmentScholarshipUser { isGraduated: boolean | null; graduatedDate: Date | null; graduatedReason: string | null; - budgetSourceOther?: number | null; + budgetSourceOther?: string | null; } diff --git a/src/migration/1745313881448-update_table_developScholaship_edit_type.ts b/src/migration/1745313881448-update_table_developScholaship_edit_type.ts new file mode 100644 index 0000000..c6c393f --- /dev/null +++ b/src/migration/1745313881448-update_table_developScholaship_edit_type.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableDevelopScholashipEditType1745313881448 implements MigrationInterface { + name = 'UpdateTableDevelopScholashipEditType1745313881448' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`developmentScholarship\` DROP COLUMN \`budgetSourceOther\``); + await queryRunner.query(`ALTER TABLE \`developmentScholarship\` ADD \`budgetSourceOther\` varchar(255) NULL COMMENT 'เงินอื่นๆ'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`developmentScholarship\` DROP COLUMN \`budgetSourceOther\``); + await queryRunner.query(`ALTER TABLE \`developmentScholarship\` ADD \`budgetSourceOther\` int NULL COMMENT 'เงินอื่นๆ'`); + } + +}