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

@@ -26,7 +26,7 @@ export class RunnerCard {
* The runner that is currently associated with this card.
*/
@IsOptional()
@ManyToOne(() => Runner, runner => runner.cards)
@ManyToOne(() => Runner, runner => runner.cards, { nullable: true })
runner: Runner;
/**
@@ -51,6 +51,6 @@ export class RunnerCard {
/**
* Used to link cards to a track scans.
*/
@OneToMany(() => TrackScan, scan => scan.track)
@OneToMany(() => TrackScan, scan => scan.track, { nullable: true })
scans: TrackScan[];
}