hrms-api-org/src/migration/1737360654848-update_table_add_isCommission.ts
2025-01-20 15:14:00 +07:00

16 lines
963 B
TypeScript

import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTableAddIsCommission1737360654848 implements MigrationInterface {
name = 'UpdateTableAddIsCommission1737360654848'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`orgChild1\` ADD \`isInformation\` tinyint NOT NULL COMMENT 'ศูนย์สารสนเทศทรัพยากรบุคคล' DEFAULT 0`);
await queryRunner.query(`ALTER TABLE \`orgRoot\` ADD \`isCommission\` tinyint NOT NULL COMMENT 'สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานคร' DEFAULT 0`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`orgRoot\` DROP COLUMN \`isCommission\``);
await queryRunner.query(`ALTER TABLE \`orgChild1\` DROP COLUMN \`isInformation\``);
}
}