Migrate update_command_add_shortName #242
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m2s

This commit is contained in:
harid 2026-05-26 15:30:51 +07:00
parent 136a4c562e
commit 81e8dadd9b
3 changed files with 108 additions and 22 deletions

View file

@ -0,0 +1,14 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateCommandAddShortName1779776860350 implements MigrationInterface {
name = 'UpdateCommandAddShortName1779776860350'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`command\` ADD \`shortName\` varchar(16) NULL COMMENT 'ชื่อย่อหน่วยงานที่ออกคำสั่ง'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`command\` DROP COLUMN \`shortName\``);
}
}