fix: religion relation

This commit is contained in:
Methapon2001 2024-03-21 16:29:51 +07:00
parent c32883f2e8
commit 02878b769b
3 changed files with 37 additions and 21 deletions

View file

@ -1,5 +1,7 @@
import { Entity, Column} from "typeorm";
import { Entity, Column, OneToMany } from "typeorm";
import { EntityBase } from "./base/Base";
import { Profile } from "./Profile";
import { ProfileEmployee } from "./ProfileEmployee";
@Entity("religion")
export class Religion extends EntityBase {
@ -10,6 +12,12 @@ export class Religion extends EntityBase {
default: null,
})
name: string;
@OneToMany(() => Profile, (v) => v.religion)
profile: Profile[];
@OneToMany(() => ProfileEmployee, (v) => v.religion)
profileEmployee: ProfileEmployee[];
}
export class CreateReligion {