This commit is contained in:
kittapath 2025-01-28 11:16:50 +07:00
parent 03a7b45aa3
commit a27dbaf3aa
2 changed files with 27 additions and 1 deletions

View file

@ -189,11 +189,17 @@ export class Profile extends EntityBase {
isProbation: boolean;
@Column({
comment: "เกษียณ",
comment: "พ้นราชการ",
default: false,
})
isLeave: boolean;
@Column({
comment: "เกษียณ",
default: false,
})
isRetirement: boolean;
@Column({
comment: "สถานะการใช้งาน",
default: true,

View file

@ -0,0 +1,20 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateprofileaddisRetirement1738037460278 implements MigrationInterface {
name = 'UpdateprofileaddisRetirement1738037460278'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profile\` ADD \`isRetirement\` tinyint NOT NULL COMMENT 'เกษียณ' DEFAULT 0`);
await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`isRetirement\` tinyint NOT NULL COMMENT 'เกษียณ' DEFAULT 0`);
await queryRunner.query(`ALTER TABLE \`profile\` CHANGE \`isLeave\` \`isLeave\` tinyint NOT NULL COMMENT 'พ้นราชการ' DEFAULT 0`);
await queryRunner.query(`ALTER TABLE \`profileHistory\` CHANGE \`isLeave\` \`isLeave\` tinyint NOT NULL COMMENT 'พ้นราชการ' DEFAULT 0`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileHistory\` CHANGE \`isLeave\` \`isLeave\` tinyint NOT NULL COMMENT 'เกษียณ' DEFAULT '0'`);
await queryRunner.query(`ALTER TABLE \`profile\` CHANGE \`isLeave\` \`isLeave\` tinyint NOT NULL COMMENT 'เกษียณ' DEFAULT '0'`);
await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`isRetirement\``);
await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`isRetirement\``);
}
}