Updated relationships to be nullable

ref #11 #13
This commit is contained in:
2020-12-02 19:45:02 +01:00
parent aa565c6b34
commit 4c80ab1516
17 changed files with 32 additions and 32 deletions

View File

@@ -15,25 +15,25 @@ export class Runner extends Participant {
* The runner's associated group.
*/
@IsNotEmpty()
@ManyToOne(() => RunnerGroup, group => group.runners)
@ManyToOne(() => RunnerGroup, group => group.runners, { nullable: true })
group: RunnerGroup;
/**
* Used to link runners to donations.
*/
@OneToMany(() => DistanceDonation, distanceDonation => distanceDonation.runner)
@OneToMany(() => DistanceDonation, distanceDonation => distanceDonation.runner, { nullable: true })
distanceDonations: DistanceDonation[];
/**
* Used to link runners to cards.
*/
@OneToMany(() => RunnerCard, card => card.runner)
@OneToMany(() => RunnerCard, card => card.runner, { nullable: true })
cards: RunnerCard[];
/**
* Used to link runners to a scans
*/
@OneToMany(() => Scan, scan => scan.runner)
@OneToMany(() => Scan, scan => scan.runner, { nullable: true })
scans: Scan[];
@IsInt()