hrms-api-org/src/migration/1726209768514-update_child1_add_isOfficer.ts
2024-09-13 15:34:01 +07:00

18 lines
1 KiB
TypeScript

import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateChild1AddIsOfficer1726209768514 implements MigrationInterface {
name = 'UpdateChild1AddIsOfficer1726209768514'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`employeePosMaster\` DROP COLUMN \`isOfficer\``);
await queryRunner.query(`ALTER TABLE \`posMaster\` DROP COLUMN \`isOfficer\``);
await queryRunner.query(`ALTER TABLE \`orgChild1\` ADD \`isOfficer\` tinyint NOT NULL COMMENT 'เป็นสกจ' DEFAULT 0`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`orgChild1\` DROP COLUMN \`isOfficer\``);
await queryRunner.query(`ALTER TABLE \`posMaster\` ADD \`isOfficer\` tinyint NOT NULL COMMENT 'เป็นสกจ' DEFAULT '0'`);
await queryRunner.query(`ALTER TABLE \`employeePosMaster\` ADD \`isOfficer\` tinyint NOT NULL COMMENT 'เป็นสกจ' DEFAULT '0'`);
}
}