migrate
This commit is contained in:
parent
03a7b45aa3
commit
a27dbaf3aa
2 changed files with 27 additions and 1 deletions
|
|
@ -189,11 +189,17 @@ export class Profile extends EntityBase {
|
||||||
isProbation: boolean;
|
isProbation: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
comment: "เกษียณ",
|
comment: "พ้นราชการ",
|
||||||
default: false,
|
default: false,
|
||||||
})
|
})
|
||||||
isLeave: boolean;
|
isLeave: boolean;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
comment: "เกษียณ",
|
||||||
|
default: false,
|
||||||
|
})
|
||||||
|
isRetirement: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
comment: "สถานะการใช้งาน",
|
comment: "สถานะการใช้งาน",
|
||||||
default: true,
|
default: true,
|
||||||
|
|
|
||||||
20
src/migration/1738037460278-UpdateprofileaddisRetirement.ts
Normal file
20
src/migration/1738037460278-UpdateprofileaddisRetirement.ts
Normal 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\``);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue