เพิ่ม table Profile ทำ relation 2 field

This commit is contained in:
AdisakKanthawilang 2024-02-06 10:12:41 +07:00
parent f9bafbb4f1
commit 6804332f40
2 changed files with 73 additions and 1 deletions

View file

@ -8,6 +8,7 @@ import { OrgChild1 } from "./OrgChild1";
import { OrgChild2 } from "./OrgChild2";
import { OrgChild3 } from "./OrgChild3";
import { OrgChild4 } from "./OrgChild4";
import { Profile } from "./Profile";
enum PosMasterLine {
MAIN = "MAIN",
@ -136,13 +137,15 @@ export class PosMaster extends EntityBase {
default: null,
})
profileIdNextHolder: string;
@Column({
length: 40,
comment: "คีย์นอก(FK)ของตาราง orgRevision",
})
orgRevisionId: string; //fk
@ManyToOne(() => OrgRevision, (orgRevision) => orgRevision.posMasters)
@JoinColumn({ name: "orgRevisionId" })
orgRevision: OrgRevision;
@ -167,6 +170,14 @@ export class PosMaster extends EntityBase {
@JoinColumn({ name: "orgChild4Id" })
orgChild4: OrgChild4;
@ManyToOne(() => Profile, (profile) => profile.posMasters)
@JoinColumn({ name: "profileIdCurrentHolder" })
profile: Profile;
@ManyToOne(() => Profile, (profile) => profile.next_holder_posMasters)
@JoinColumn({ name: "profileIdNextHolder" })
next_holder: Profile;
@OneToMany(() => Position, (position) => position.posMaster)
positions: Position[];
}