18 lines
1 KiB
TypeScript
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'`);
|
|
}
|
|
|
|
}
|