Migrate update employeePosLevel.posLevelName Change Int to Number
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m18s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m18s
This commit is contained in:
parent
e8890133bb
commit
cdbdfce7af
4 changed files with 53 additions and 17 deletions
|
|
@ -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 'ชื่อระดับชั้นงาน'
|
||||
`);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue