migrate (LONGTEXT)

This commit is contained in:
harid 2025-11-26 11:47:13 +07:00
parent 580df20c92
commit 9605365fe8
9 changed files with 101 additions and 13 deletions

View file

@ -81,6 +81,7 @@ export class Assign extends EntityBase {
active: number
@Column({
type: "longtext",
nullable: true,
comment: "กฎหมายอื่นๆ",
})

View file

@ -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: "ผลการปฏิบัติงานเป้าหมาย",
})

View file

@ -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: "ตัวชี้วัดความสําเร็จของงาน",
})

View file

@ -46,7 +46,7 @@ export class EvaluateAchievement extends EntityBase {
evaluate_expect_level: number;
@Column({
type: "text",
type: "longtext",
nullable: false,
comment: "คำอธิบายผลผลิตของงานที่เกิดขึ้นจริง",
default: null,

View file

@ -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: "สิ่งที่ควรปรับปรุงของความประพฤติ",
})

View file

@ -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: "ความประพฤติอื่นๆ",
})

View file

@ -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: "สิ่งที่ควรปรับปรุงของความประพฤติ",
})

View file

@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTableEvaluateCommanderChangeDatatypeStringToLongtext1764084713119 implements MigrationInterface {
name = 'UpdateTableEvaluateCommanderChangeDatatypeStringToLongtext1764084713119'
public async up(queryRunner: QueryRunner): Promise<void> {
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<void> {
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 'ความประพฤติอื่นๆ'`);
}
}

View file

@ -0,0 +1,68 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateDatatypeTextToLongtext1764128868573 implements MigrationInterface {
name = 'UpdateDatatypeTextToLongtext1764128868573'
public async up(queryRunner: QueryRunner): Promise<void> {
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<void> {
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 'ผลการปฏิบัติงานกิจกรรม/ขั้นตอนการปฏิบัติ'`);
}
}