ปรับrelation geverment

This commit is contained in:
Bright 2024-05-14 16:20:18 +07:00
parent dd06c1f71f
commit e99bd89b1e
2 changed files with 5 additions and 1 deletions

View file

@ -20,6 +20,7 @@ import { ProfileEducation } from "./ProfileEducation";
import { ProfileAbility } from "./ProfileAbility"; import { ProfileAbility } from "./ProfileAbility";
import { ProfileOther } from "./ProfileOther"; import { ProfileOther } from "./ProfileOther";
import { ProfileAvatar } from "./ProfileAvatar"; import { ProfileAvatar } from "./ProfileAvatar";
import { ProfileGovernment } from "./ProfileGovernment";
@Entity("profileEmployee") @Entity("profileEmployee")
export class ProfileEmployee extends EntityBase { export class ProfileEmployee extends EntityBase {
@Column({ @Column({
@ -274,6 +275,9 @@ export class ProfileEmployee extends EntityBase {
@OneToMany(() => ProfileEmployeeHistory, (v) => v.profileEmployee) @OneToMany(() => ProfileEmployeeHistory, (v) => v.profileEmployee)
histories: ProfileEmployeeHistory[]; histories: ProfileEmployeeHistory[];
@OneToMany(() => ProfileGovernment, (v) => v.profileEmployee)
profileGovernment: ProfileGovernment[];
} }
@Entity("profileEmployeeHistory") @Entity("profileEmployeeHistory")

View file

@ -62,7 +62,7 @@ export class ProfileGovernment extends EntityBase {
@JoinColumn({ name: "profileId" }) @JoinColumn({ name: "profileId" })
profile: Profile; profile: Profile;
@ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileTrainings) @ManyToOne(() => ProfileEmployee, (v) => v.profileGovernment)
@JoinColumn({ name: "profileEmployeeId" }) @JoinColumn({ name: "profileEmployeeId" })
profileEmployee: ProfileEmployee; profileEmployee: ProfileEmployee;
} }