diff options
Diffstat (limited to 'util/src/entities/Team.ts')
-rw-r--r-- | util/src/entities/Team.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/util/src/entities/Team.ts b/util/src/entities/Team.ts index b37f368c..beb8bf68 100644 --- a/util/src/entities/Team.ts +++ b/util/src/entities/Team.ts @@ -1,4 +1,4 @@ -import { Column, Entity, JoinColumn, ManyToMany, ManyToOne, RelationId } from "typeorm"; +import { Column, Entity, JoinColumn, ManyToMany, ManyToOne, OneToMany, RelationId } from "typeorm"; import { BaseClass } from "./BaseClass"; import { TeamMember } from "./TeamMember"; import { User } from "./User"; @@ -8,20 +8,18 @@ export class Team extends BaseClass { @Column({ nullable: true }) icon?: string; - @RelationId((team: Team) => team.members) - member_ids: string[]; - @JoinColumn({ name: "member_ids" }) - @ManyToMany(() => TeamMember, (member: TeamMember) => member.id) + @OneToMany(() => TeamMember, (member: TeamMember) => member.team) members: TeamMember[]; @Column() name: string; + @Column({ nullable: true }) @RelationId((team: Team) => team.owner_user) owner_user_id: string; @JoinColumn({ name: "owner_user_id" }) - @ManyToOne(() => User, (user: User) => user.id) + @ManyToOne(() => User) owner_user: User; } |