เพิ่มแก้ไขโครงสร้าง

This commit is contained in:
kittapath 2024-09-06 09:41:47 +07:00
parent bee2b69f61
commit 98ebf587a3
16 changed files with 565 additions and 410 deletions

View 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;
}