Skip to content

Commit

Permalink
Add entity relationship match.teams (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
niekcandaele authored Jul 26, 2020
1 parent 4b29b41 commit dbf781c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions entities/match.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { BaseEntity, Column, Entity, JoinTable, ManyToMany, OneToMany, PrimaryGe
import { IMatchType } from '../types/matchType.interface';
import { Player } from './player.entity';
import { Round } from './round.entity';
import { Team } from './team.entity';

/**
* Match database record
Expand Down Expand Up @@ -67,4 +68,7 @@ export class Match extends BaseEntity {

@OneToMany(() => Round, (round) => round.match)
rounds: Round[];

@ManyToMany(() => Team, (team) => team.matches)
teams: Team[];
}

0 comments on commit dbf781c

Please sign in to comment.