เพิ่มแก้ไขโครงสร้าง
This commit is contained in:
parent
bee2b69f61
commit
98ebf587a3
16 changed files with 565 additions and 410 deletions
27
src/entities/PermissionOrg.ts
Normal file
27
src/entities/PermissionOrg.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { OrgRoot } from "./OrgRoot";
|
||||
import { Profile } from "./Profile";
|
||||
|
||||
@Entity("permissionOrg")
|
||||
export class PermissionOrg extends EntityBase {
|
||||
@Column({
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง orgRoot",
|
||||
})
|
||||
orgRootId: string;
|
||||
|
||||
@Column({
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง profile",
|
||||
})
|
||||
profileId: string;
|
||||
|
||||
@ManyToOne(() => OrgRoot, (orgRoot) => orgRoot.permissionOrgRoots)
|
||||
@JoinColumn({ name: "orgRootId" })
|
||||
orgRootTree: OrgRoot;
|
||||
|
||||
@ManyToOne(() => Profile, (profile) => profile.permissionProfiles)
|
||||
@JoinColumn({ name: "profileId" })
|
||||
profileTree: Profile;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue