fix and relation emp
This commit is contained in:
parent
497db161c4
commit
c441df3dc9
5 changed files with 72 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { Column, Entity, ManyToOne, OneToMany } from "typeorm";
|
||||
import { Column, Entity, ManyToOne, OneToMany, JoinColumn } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { Profile } from "./Profile";
|
||||
import { ProfileEmployee } from "./ProfileEmployee";
|
||||
|
||||
@Entity("profileFamilyHistory")
|
||||
export class ProfileFamilyHistory extends EntityBase {
|
||||
|
|
@ -155,11 +156,23 @@ export class ProfileFamilyHistory extends EntityBase {
|
|||
})
|
||||
profileId: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง ProfileEmployee",
|
||||
default: null,
|
||||
})
|
||||
profileEmployeeId: string;
|
||||
|
||||
@ManyToOne(() => Profile, (v) => v.profileFamily)
|
||||
profile: Profile;
|
||||
|
||||
@OneToMany(() => ProfileChildrenHistory, (v) => v.profileFamilyHistory)
|
||||
profileChildrenHistories: ProfileChildrenHistory[];
|
||||
|
||||
@ManyToOne(() => ProfileEmployee, (ProfileEmployee) => ProfileEmployee.profileFamilys)
|
||||
@JoinColumn({ name: "profileEmployeeId" })
|
||||
profileEmployee: ProfileEmployee;
|
||||
}
|
||||
|
||||
@Entity("profileChildren")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue