Migrate update employeePosLevel.posLevelName Change Int to Number
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m18s

This commit is contained in:
harid 2026-02-24 13:28:57 +07:00
parent e8890133bb
commit cdbdfce7af
4 changed files with 53 additions and 17 deletions

View file

@ -0,0 +1,26 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateEmployeePosLevelChangeDatatypeFieldPosLevelName1771910056470 implements MigrationInterface {
name = 'UpdateEmployeePosLevelChangeDatatypeFieldPosLevelName1771910056470'
public async up(queryRunner: QueryRunner): Promise<void> {
// await queryRunner.query(`ALTER TABLE \`employeePosLevel\` DROP COLUMN \`posLevelName\``);
// await queryRunner.query(`ALTER TABLE \`employeePosLevel\` ADD \`posLevelName\` varchar(255) NULL COMMENT 'ชื่อระดับชั้นงาน'`);
await queryRunner.query(`
ALTER TABLE \`employeePosLevel\`
MODIFY \`posLevelName\` varchar(255) NULL
COMMENT 'ชื่อระดับชั้นงาน'
`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
// await queryRunner.query(`ALTER TABLE \`employeePosLevel\` DROP COLUMN \`posLevelName\``);
// await queryRunner.query(`ALTER TABLE \`employeePosLevel\` ADD \`posLevelName\` int NOT NULL COMMENT 'ชื่อระดับชั้นงาน'`);
await queryRunner.query(`
ALTER TABLE \`employeePosLevel\`
MODIFY \`posLevelName\` int NOT NULL
COMMENT 'ชื่อระดับชั้นงาน'
`);
}
}