hrms-api-org/src/migration/1732252198299-updata_profile_add_prefixmain.ts
2024-11-22 12:18:12 +07:00

20 lines
1.4 KiB
TypeScript

import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdataProfileAddPrefixmain1732252198299 implements MigrationInterface {
name = 'UpdataProfileAddPrefixmain1732252198299'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`prefixMain\` varchar(40) NULL COMMENT 'คำนำหน้าชื่อตัวหลัก'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`prefixMain\` varchar(40) NULL COMMENT 'คำนำหน้าชื่อตัวหลัก'`);
await queryRunner.query(`ALTER TABLE \`profile\` ADD \`prefixMain\` varchar(40) NULL COMMENT 'คำนำหน้าชื่อตัวหลัก'`);
await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`prefixMain\` varchar(40) NULL COMMENT 'คำนำหน้าชื่อตัวหลัก'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`prefixMain\``);
await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`prefixMain\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`prefixMain\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`prefixMain\``);
}
}