diff --git a/src/entities/ProfileSalary.ts b/src/entities/ProfileSalary.ts index ddbe184b..1ab7acab 100644 --- a/src/entities/ProfileSalary.ts +++ b/src/entities/ProfileSalary.ts @@ -287,6 +287,13 @@ 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; diff --git a/src/entities/ProfileSalaryBackup.ts b/src/entities/ProfileSalaryBackup.ts index 29cdd325..1274e319 100644 --- a/src/entities/ProfileSalaryBackup.ts +++ b/src/entities/ProfileSalaryBackup.ts @@ -292,4 +292,11 @@ export class ProfileSalaryBackup extends EntityBase { }) positionArea: string; + @Column({ + nullable: false, + comment: "สถานะลบข้อมูล", + default: false, + }) + isDeleted: boolean; + } \ No newline at end of file diff --git a/src/entities/ProfileSalaryHistory.ts b/src/entities/ProfileSalaryHistory.ts index ea6af033..b5482c29 100644 --- a/src/entities/ProfileSalaryHistory.ts +++ b/src/entities/ProfileSalaryHistory.ts @@ -228,6 +228,13 @@ 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; diff --git a/src/migration/1770872734016-move_fields_isDeleted_in_tables_profileSalary.ts b/src/migration/1770872734016-move_fields_isDeleted_in_tables_profileSalary.ts deleted file mode 100644 index 31d4a79c..00000000 --- a/src/migration/1770872734016-move_fields_isDeleted_in_tables_profileSalary.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class MoveFieldsIsDeletedInTablesProfileSalary1770872734016 implements MigrationInterface { - name = 'MoveFieldsIsDeletedInTablesProfileSalary1770872734016' - - public async up(queryRunner: QueryRunner): Promise { - 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 { - 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'`); - - } - -}