Migrate move isDeleted in profileSalary

This commit is contained in:
harid 2026-02-12 12:10:14 +07:00
parent 65e3740cc2
commit f03ccb78ac
4 changed files with 19 additions and 21 deletions

View file

@ -287,13 +287,6 @@ export class ProfileSalary extends EntityBase {
})
positionArea: string;
@Column({
nullable: false,
comment: "สถานะลบข้อมูล",
default: false,
})
isDeleted: boolean;
@ManyToOne(() => Command, (command) => command.profileSalarys)
@JoinColumn({ name: "commandId" })
command: Command;

View file

@ -292,11 +292,4 @@ export class ProfileSalaryBackup extends EntityBase {
})
positionArea: string;
@Column({
nullable: false,
comment: "สถานะลบข้อมูล",
default: false,
})
isDeleted: boolean;
}

View file

@ -228,13 +228,6 @@ export class ProfileSalaryHistory extends EntityBase {
})
posNumCodeSitAbb: string;
@Column({
nullable: false,
comment: "สถานะลบข้อมูล",
default: false,
})
isDeleted: boolean;
@ManyToOne(() => Command, (command) => command.profileSalaryHistorys)
@JoinColumn({ name: "commandId" })
command: Command;

View file

@ -0,0 +1,19 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class MoveFieldsIsDeletedInTablesProfileSalary1770872734016 implements MigrationInterface {
name = 'MoveFieldsIsDeletedInTablesProfileSalary1770872734016'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileSalaryHistory\` DROP COLUMN \`isDeleted\``);
await queryRunner.query(`ALTER TABLE \`profileSalary\` DROP COLUMN \`isDeleted\``);
await queryRunner.query(`ALTER TABLE \`profileSalaryBackup\` DROP COLUMN \`isDeleted\``);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileSalaryBackup\` ADD \`isDeleted\` tinyint NOT NULL COMMENT 'สถานะลบข้อมูล' DEFAULT '0'`);
await queryRunner.query(`ALTER TABLE \`profileSalary\` ADD \`isDeleted\` tinyint NOT NULL COMMENT 'สถานะลบข้อมูล' DEFAULT '0'`);
await queryRunner.query(`ALTER TABLE \`profileSalaryHistory\` ADD \`isDeleted\` tinyint NOT NULL COMMENT 'สถานะลบข้อมูล' DEFAULT '0'`);
}
}