hrms-api-development/src/migration/1713347839774-update_table_devhis_add_org.ts
2024-04-17 17:31:07 +07:00

16 lines
877 B
TypeScript

import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTableDevhisAddOrg1713347839774 implements MigrationInterface {
name = 'UpdateTableDevhisAddOrg1713347839774'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`developmentHistory\` ADD \`org\` varchar(255) NULL COMMENT 'ชื่อหน่วยงานที่สังกัด'`);
await queryRunner.query(`ALTER TABLE \`developmentScholarship\` ADD \`org\` varchar(255) NULL COMMENT 'ชื่อหน่วยงานที่สังกัด'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`developmentScholarship\` DROP COLUMN \`org\``);
await queryRunner.query(`ALTER TABLE \`developmentHistory\` DROP COLUMN \`org\``);
}
}