diff --git a/src/entities/Assign.ts b/src/entities/Assign.ts index 6ae0879..1ade1be 100644 --- a/src/entities/Assign.ts +++ b/src/entities/Assign.ts @@ -81,6 +81,7 @@ export class Assign extends EntityBase { active: number @Column({ + type: "longtext", nullable: true, comment: "กฎหมายอื่นๆ", }) diff --git a/src/entities/AssignJob.ts b/src/entities/AssignJob.ts index 3bc1430..1d2fb0e 100644 --- a/src/entities/AssignJob.ts +++ b/src/entities/AssignJob.ts @@ -18,14 +18,14 @@ export class AssignJob extends EntityBase { id: number; @Column({ - type: "text", + type: "longtext", nullable: false, comment: "ผลการปฏิบัติงานกิจกรรม/ขั้นตอนการปฏิบัติ", }) activity_desc: string; @Column({ - type: "text", + type: "longtext", nullable: false, comment: "ผลการปฏิบัติงานเป้าหมาย", }) diff --git a/src/entities/AssignOutput.ts b/src/entities/AssignOutput.ts index ef71de5..d77311f 100644 --- a/src/entities/AssignOutput.ts +++ b/src/entities/AssignOutput.ts @@ -20,14 +20,14 @@ export class AssignOutput extends EntityBase { assign_id: string; @Column({ - type: "text", + type: "longtext", nullable: false, comment: "ผลผลิตของงานที่คาดหวัง", }) output_desc: string; @Column({ - type: "text", + type: "longtext", nullable: false, comment: "ตัวชี้วัดความสําเร็จของงาน", }) diff --git a/src/entities/EvaluateAchievement.ts b/src/entities/EvaluateAchievement.ts index fe48198..14a931f 100644 --- a/src/entities/EvaluateAchievement.ts +++ b/src/entities/EvaluateAchievement.ts @@ -46,7 +46,7 @@ export class EvaluateAchievement extends EntityBase { evaluate_expect_level: number; @Column({ - type: "text", + type: "longtext", nullable: false, comment: "คำอธิบายผลผลิตของงานที่เกิดขึ้นจริง", default: null, diff --git a/src/entities/EvaluateAssessor.ts b/src/entities/EvaluateAssessor.ts index 8a3cd8a..70e5b26 100644 --- a/src/entities/EvaluateAssessor.ts +++ b/src/entities/EvaluateAssessor.ts @@ -90,7 +90,7 @@ export class EvaluateAssessor extends EntityBase { apply_level: number; @Column({ - type: "text", + type: "longtext", nullable: true, comment: "ความสำเร็จของงานที่ได้รับมอบหมายอื่นๆ", }) @@ -103,14 +103,14 @@ export class EvaluateAssessor extends EntityBase { achievement_other_level!: number; @Column({ - type: "text", + type: "longtext", nullable: false, comment: "จุดเด่น", }) achievement_strength_desc: string; @Column({ - type: "text", + type: "longtext", nullable: false, comment: "สิ่งที่ควรปรับปรุง", }) @@ -210,7 +210,7 @@ export class EvaluateAssessor extends EntityBase { discipline5_level: number; @Column({ - type: "text", + type: "longtext", nullable: true, comment: "ความประพฤติอื่นๆ", }) @@ -223,14 +223,14 @@ export class EvaluateAssessor extends EntityBase { behavior_other_level!: number; @Column({ - type: "text", + type: "longtext", nullable: false, comment: "จุดเด่นของความประพฤติ", }) behavior_strength_desc: string; @Column({ - type: "text", + type: "longtext", nullable: false, comment: "สิ่งที่ควรปรับปรุงของความประพฤติ", }) diff --git a/src/entities/EvaluateChairman.ts b/src/entities/EvaluateChairman.ts index 6004e64..69e27aa 100644 --- a/src/entities/EvaluateChairman.ts +++ b/src/entities/EvaluateChairman.ts @@ -70,7 +70,7 @@ export class EvaluateChairman extends EntityBase { success_level: number; @Column({ - type: "text", + type: "longtext", nullable: true, comment: "ความสำเร็จของงานที่ได้รับมอบหมายอื่นๆ", }) @@ -172,7 +172,7 @@ export class EvaluateChairman extends EntityBase { discipline5_level: number; @Column({ - type: "text", + type: "longtext", nullable: true, comment: "ความประพฤติอื่นๆ", }) diff --git a/src/entities/EvaluateCommander.ts b/src/entities/EvaluateCommander.ts index 86818ce..1091a4e 100644 --- a/src/entities/EvaluateCommander.ts +++ b/src/entities/EvaluateCommander.ts @@ -202,6 +202,7 @@ export class EvaluateCommander extends EntityBase { discipline5_level: number; @Column({ + type: "longtext", nullable: true, comment: "ความประพฤติอื่นๆ", }) @@ -214,12 +215,14 @@ export class EvaluateCommander extends EntityBase { behavior_other_level!: number; @Column({ + type: "longtext", nullable: false, comment: "จุดเด่นของความประพฤติ", }) behavior_strength_desc: string; @Column({ + type: "longtext", nullable: false, comment: "สิ่งที่ควรปรับปรุงของความประพฤติ", }) diff --git a/src/migration/1764084713119-update_table_evaluateCommander_change_datatype_string_to_longtext.ts b/src/migration/1764084713119-update_table_evaluateCommander_change_datatype_string_to_longtext.ts new file mode 100644 index 0000000..bc205fd --- /dev/null +++ b/src/migration/1764084713119-update_table_evaluateCommander_change_datatype_string_to_longtext.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableEvaluateCommanderChangeDatatypeStringToLongtext1764084713119 implements MigrationInterface { + name = 'UpdateTableEvaluateCommanderChangeDatatypeStringToLongtext1764084713119' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`evaluateCommander\` DROP COLUMN \`behavior_other_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateCommander\` ADD \`behavior_other_desc\` longtext NULL COMMENT 'ความประพฤติอื่นๆ'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`evaluateCommander\` DROP COLUMN \`behavior_other_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateCommander\` ADD \`behavior_other_desc\` varchar(255) NULL COMMENT 'ความประพฤติอื่นๆ'`); + } + +} diff --git a/src/migration/1764128868573-update_datatype_text_to_longtext.ts b/src/migration/1764128868573-update_datatype_text_to_longtext.ts new file mode 100644 index 0000000..7579e6f --- /dev/null +++ b/src/migration/1764128868573-update_datatype_text_to_longtext.ts @@ -0,0 +1,68 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateDatatypeTextToLongtext1764128868573 implements MigrationInterface { + name = 'UpdateDatatypeTextToLongtext1764128868573' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`assignJob\` DROP COLUMN \`activity_desc\``); + await queryRunner.query(`ALTER TABLE \`assignJob\` ADD \`activity_desc\` longtext NOT NULL COMMENT 'ผลการปฏิบัติงานกิจกรรม/ขั้นตอนการปฏิบัติ'`); + await queryRunner.query(`ALTER TABLE \`assignJob\` DROP COLUMN \`goal_desc\``); + await queryRunner.query(`ALTER TABLE \`assignJob\` ADD \`goal_desc\` longtext NOT NULL COMMENT 'ผลการปฏิบัติงานเป้าหมาย'`); + await queryRunner.query(`ALTER TABLE \`assignOutput\` DROP COLUMN \`output_desc\``); + await queryRunner.query(`ALTER TABLE \`assignOutput\` ADD \`output_desc\` longtext NOT NULL COMMENT 'ผลผลิตของงานที่คาดหวัง'`); + await queryRunner.query(`ALTER TABLE \`assignOutput\` DROP COLUMN \`indicator_desc\``); + await queryRunner.query(`ALTER TABLE \`assignOutput\` ADD \`indicator_desc\` longtext NOT NULL COMMENT 'ตัวชี้วัดความสําเร็จของงาน'`); + await queryRunner.query(`ALTER TABLE \`evaluateAchievement\` DROP COLUMN \`output_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateAchievement\` ADD \`output_desc\` longtext NOT NULL COMMENT 'คำอธิบายผลผลิตของงานที่เกิดขึ้นจริง'`); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` DROP COLUMN \`achievement_other_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` ADD \`achievement_other_desc\` longtext NULL COMMENT 'ความสำเร็จของงานที่ได้รับมอบหมายอื่นๆ'`); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` DROP COLUMN \`achievement_strength_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` ADD \`achievement_strength_desc\` longtext NOT NULL COMMENT 'จุดเด่น'`); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` DROP COLUMN \`achievement_improve_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` ADD \`achievement_improve_desc\` longtext NOT NULL COMMENT 'สิ่งที่ควรปรับปรุง'`); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` DROP COLUMN \`behavior_other_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` ADD \`behavior_other_desc\` longtext NULL COMMENT 'ความประพฤติอื่นๆ'`); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` DROP COLUMN \`behavior_strength_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` ADD \`behavior_strength_desc\` longtext NOT NULL COMMENT 'จุดเด่นของความประพฤติ'`); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` DROP COLUMN \`behavior_improve_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` ADD \`behavior_improve_desc\` longtext NOT NULL COMMENT 'สิ่งที่ควรปรับปรุงของความประพฤติ'`); + await queryRunner.query(`ALTER TABLE \`evaluateChairman\` DROP COLUMN \`achievement_other_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateChairman\` ADD \`achievement_other_desc\` longtext NULL COMMENT 'ความสำเร็จของงานที่ได้รับมอบหมายอื่นๆ'`); + await queryRunner.query(`ALTER TABLE \`evaluateChairman\` DROP COLUMN \`behavior_other_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateChairman\` ADD \`behavior_other_desc\` longtext NULL COMMENT 'ความประพฤติอื่นๆ'`); + await queryRunner.query(`ALTER TABLE \`assign\` DROP COLUMN \`other_desc\``); + await queryRunner.query(`ALTER TABLE \`assign\` ADD \`other_desc\` longtext NULL COMMENT 'กฎหมายอื่นๆ'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`assign\` DROP COLUMN \`other_desc\``); + await queryRunner.query(`ALTER TABLE \`assign\` ADD \`other_desc\` varchar(255) NULL COMMENT 'กฎหมายอื่นๆ'`); + await queryRunner.query(`ALTER TABLE \`evaluateChairman\` DROP COLUMN \`behavior_other_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateChairman\` ADD \`behavior_other_desc\` text NULL COMMENT 'ความประพฤติอื่นๆ'`); + await queryRunner.query(`ALTER TABLE \`evaluateChairman\` DROP COLUMN \`achievement_other_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateChairman\` ADD \`achievement_other_desc\` text NULL COMMENT 'ความสำเร็จของงานที่ได้รับมอบหมายอื่นๆ'`); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` DROP COLUMN \`behavior_improve_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` ADD \`behavior_improve_desc\` text NOT NULL COMMENT 'สิ่งที่ควรปรับปรุงของความประพฤติ'`); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` DROP COLUMN \`behavior_strength_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` ADD \`behavior_strength_desc\` text NOT NULL COMMENT 'จุดเด่นของความประพฤติ'`); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` DROP COLUMN \`behavior_other_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` ADD \`behavior_other_desc\` text NULL COMMENT 'ความประพฤติอื่นๆ'`); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` DROP COLUMN \`achievement_improve_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` ADD \`achievement_improve_desc\` text NOT NULL COMMENT 'สิ่งที่ควรปรับปรุง'`); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` DROP COLUMN \`achievement_strength_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` ADD \`achievement_strength_desc\` text NOT NULL COMMENT 'จุดเด่น'`); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` DROP COLUMN \`achievement_other_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateAssessor\` ADD \`achievement_other_desc\` text NULL COMMENT 'ความสำเร็จของงานที่ได้รับมอบหมายอื่นๆ'`); + await queryRunner.query(`ALTER TABLE \`evaluateAchievement\` DROP COLUMN \`output_desc\``); + await queryRunner.query(`ALTER TABLE \`evaluateAchievement\` ADD \`output_desc\` text NOT NULL COMMENT 'คำอธิบายผลผลิตของงานที่เกิดขึ้นจริง'`); + await queryRunner.query(`ALTER TABLE \`assignOutput\` DROP COLUMN \`indicator_desc\``); + await queryRunner.query(`ALTER TABLE \`assignOutput\` ADD \`indicator_desc\` text NOT NULL COMMENT 'ตัวชี้วัดความสําเร็จของงาน'`); + await queryRunner.query(`ALTER TABLE \`assignOutput\` DROP COLUMN \`output_desc\``); + await queryRunner.query(`ALTER TABLE \`assignOutput\` ADD \`output_desc\` text NOT NULL COMMENT 'ผลผลิตของงานที่คาดหวัง'`); + await queryRunner.query(`ALTER TABLE \`assignJob\` DROP COLUMN \`goal_desc\``); + await queryRunner.query(`ALTER TABLE \`assignJob\` ADD \`goal_desc\` text NOT NULL COMMENT 'ผลการปฏิบัติงานเป้าหมาย'`); + await queryRunner.query(`ALTER TABLE \`assignJob\` DROP COLUMN \`activity_desc\``); + await queryRunner.query(`ALTER TABLE \`assignJob\` ADD \`activity_desc\` text NOT NULL COMMENT 'ผลการปฏิบัติงานกิจกรรม/ขั้นตอนการปฏิบัติ'`); + } + +}