This commit is contained in:
Kittapath 2024-06-06 14:11:49 +07:00
parent 8f7f8eaab6
commit 9bb3d3ccd9
2 changed files with 309 additions and 0 deletions

View file

@ -276,6 +276,195 @@ export class ProfileEmployee extends EntityBase {
})
bloodGroup: string;
@Column({
nullable: true,
comment: "id อัตรา",
default: null,
})
posmasterIdTemp: string;
@Column({
nullable: true,
comment: "node",
default: null,
})
nodeTemp: string;
@Column({
nullable: true,
comment: "id node",
default: null,
})
nodeIdTemp: string;
@Column({
nullable: true,
comment: "id Revision",
default: null,
})
orgRevisionIdTemp: string;
@Column({
nullable: true,
comment: "id position",
default: null,
})
positionIdTemp: string;
@Column({
nullable: true,
comment: "เลขที่ตำแหน่ง",
default: null,
})
posMasterNoTemp: string;
@Column({
nullable: true,
comment: "ตำแหน่ง",
default: null,
})
positionTemp: string;
@Column({
nullable: true,
comment: "ตำแหน่ง",
default: null,
})
positionFieldTemp: string;
@Column({
nullable: true,
comment: "id ประเภท",
default: null,
})
posTypeIdTemp: string;
@Column({
nullable: true,
comment: "ประเภท",
default: null,
})
posTypeNameTemp: string;
@Column({
nullable: true,
comment: "id ระดับ",
default: null,
})
posLevelIdTemp: string;
@Column({
nullable: true,
comment: "ระดับ",
default: null,
})
posLevelNameTemp: string;
@Column({
nullable: true,
comment: "ชื่อ root",
default: null,
})
rootTemp: string;
@Column({
nullable: true,
comment: "id root",
default: null,
})
rootId: string;
@Column({
nullable: true,
comment: "ชื่อย่อ root",
default: null,
})
rootShortName: string;
@Column({
nullable: true,
comment: "ชื่อ child1",
default: null,
})
child1Temp: string;
@Column({
nullable: true,
comment: "id child1",
default: null,
})
child1Id: string;
@Column({
nullable: true,
comment: "ชื่อย่อ child1",
default: null,
})
child1ShortName: string;
@Column({
nullable: true,
comment: "ชื่อ child2",
default: null,
})
child2Temp: string;
@Column({
nullable: true,
comment: "id child2",
default: null,
})
child2Id: string;
@Column({
nullable: true,
comment: "ชื่อย่อ child2",
default: null,
})
child2ShortName: string;
@Column({
nullable: true,
comment: "ชื่อ child3",
default: null,
})
child3Temp: string;
@Column({
nullable: true,
comment: "id child3",
default: null,
})
child3Id: string;
@Column({
nullable: true,
comment: "ชื่อย่อ child3",
default: null,
})
child3ShortName: string;
@Column({
nullable: true,
comment: "ชื่อ child4",
default: null,
})
child4Temp: string;
@Column({
nullable: true,
comment: "id child4",
default: null,
})
child4Id: string;
@Column({
nullable: true,
comment: "ชื่อย่อ child4",
default: null,
})
child4ShortName: string;
@OneToMany(() => EmployeePosMaster, (v) => v.current_holder)
current_holders: EmployeePosMaster[];

View file

@ -0,0 +1,120 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateTableSalaryProfileAddRank11717657751779 implements MigrationInterface {
name = 'UpdateTableSalaryProfileAddRank11717657751779'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`posmasterIdTemp\` varchar(255) NULL COMMENT 'id อัตรา'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`nodeTemp\` varchar(255) NULL COMMENT 'node'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`nodeIdTemp\` varchar(255) NULL COMMENT 'id node'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`orgRevisionIdTemp\` varchar(255) NULL COMMENT 'id Revision'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`positionIdTemp\` varchar(255) NULL COMMENT 'id position'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`posMasterNoTemp\` varchar(255) NULL COMMENT 'เลขที่ตำแหน่ง'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`positionTemp\` varchar(255) NULL COMMENT 'ตำแหน่ง'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`positionFieldTemp\` varchar(255) NULL COMMENT 'ตำแหน่ง'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`posTypeIdTemp\` varchar(255) NULL COMMENT 'id ประเภท'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`posTypeNameTemp\` varchar(255) NULL COMMENT 'ประเภท'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`posLevelIdTemp\` varchar(255) NULL COMMENT 'id ระดับ'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`posLevelNameTemp\` varchar(255) NULL COMMENT 'ระดับ'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`rootTemp\` varchar(255) NULL COMMENT 'ชื่อ root'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`rootId\` varchar(255) NULL COMMENT 'id root'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`rootShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ root'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child1Temp\` varchar(255) NULL COMMENT 'ชื่อ child1'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child1Id\` varchar(255) NULL COMMENT 'id child1'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child1ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child1'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child2Temp\` varchar(255) NULL COMMENT 'ชื่อ child2'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child2Id\` varchar(255) NULL COMMENT 'id child2'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child2ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child2'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child3Temp\` varchar(255) NULL COMMENT 'ชื่อ child3'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child3Id\` varchar(255) NULL COMMENT 'id child3'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child3ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child3'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child4Temp\` varchar(255) NULL COMMENT 'ชื่อ child4'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child4Id\` varchar(255) NULL COMMENT 'id child4'`);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`child4ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child4'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`posmasterIdTemp\` varchar(255) NULL COMMENT 'id อัตรา'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`nodeTemp\` varchar(255) NULL COMMENT 'node'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`nodeIdTemp\` varchar(255) NULL COMMENT 'id node'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`orgRevisionIdTemp\` varchar(255) NULL COMMENT 'id Revision'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`positionIdTemp\` varchar(255) NULL COMMENT 'id position'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`posMasterNoTemp\` varchar(255) NULL COMMENT 'เลขที่ตำแหน่ง'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`positionTemp\` varchar(255) NULL COMMENT 'ตำแหน่ง'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`positionFieldTemp\` varchar(255) NULL COMMENT 'ตำแหน่ง'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`posTypeIdTemp\` varchar(255) NULL COMMENT 'id ประเภท'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`posTypeNameTemp\` varchar(255) NULL COMMENT 'ประเภท'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`posLevelIdTemp\` varchar(255) NULL COMMENT 'id ระดับ'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`posLevelNameTemp\` varchar(255) NULL COMMENT 'ระดับ'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`rootTemp\` varchar(255) NULL COMMENT 'ชื่อ root'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`rootId\` varchar(255) NULL COMMENT 'id root'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`rootShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ root'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child1Temp\` varchar(255) NULL COMMENT 'ชื่อ child1'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child1Id\` varchar(255) NULL COMMENT 'id child1'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child1ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child1'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child2Temp\` varchar(255) NULL COMMENT 'ชื่อ child2'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child2Id\` varchar(255) NULL COMMENT 'id child2'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child2ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child2'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child3Temp\` varchar(255) NULL COMMENT 'ชื่อ child3'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child3Id\` varchar(255) NULL COMMENT 'id child3'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child3ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child3'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child4Temp\` varchar(255) NULL COMMENT 'ชื่อ child4'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child4Id\` varchar(255) NULL COMMENT 'id child4'`);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`child4ShortName\` varchar(255) NULL COMMENT 'ชื่อย่อ child4'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child4ShortName\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child4Id\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child4Temp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child3ShortName\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child3Id\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child3Temp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child2ShortName\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child2Id\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child2Temp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child1ShortName\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child1Id\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`child1Temp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`rootShortName\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`rootId\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`rootTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`posLevelNameTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`posLevelIdTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`posTypeNameTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`posTypeIdTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`positionFieldTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`positionTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`posMasterNoTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`positionIdTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`orgRevisionIdTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`nodeIdTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`nodeTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`posmasterIdTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child4ShortName\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child4Id\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child4Temp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child3ShortName\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child3Id\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child3Temp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child2ShortName\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child2Id\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child2Temp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child1ShortName\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child1Id\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`child1Temp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`rootShortName\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`rootId\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`rootTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`posLevelNameTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`posLevelIdTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`posTypeNameTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`posTypeIdTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`positionFieldTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`positionTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`posMasterNoTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`positionIdTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`orgRevisionIdTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`nodeIdTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`nodeTemp\``);
await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`posmasterIdTemp\``);
}
}