Forráskód Böngészése

Fix many-to-one mapping typo in contests

ghorsington 5 éve
szülő
commit
327c0edf0b
2 módosított fájl, 2 hozzáadás és 3 törlés
  1. 2 2
      db/src/entity/ContestEntry.ts
  2. 0 1
      db/src/entity/ContestVote.ts

+ 2 - 2
db/src/entity/ContestEntry.ts

@@ -1,4 +1,4 @@
-import {Entity, PrimaryColumn, Column, ManyToOne, JoinColumn} from "typeorm";
+import {Entity, PrimaryColumn, ManyToOne, OneToMany} from "typeorm";
 import {Contest} from "./Contest";
 import { ContestVote } from "./ContestVote";
 
@@ -11,6 +11,6 @@ export class ContestEntry {
     @ManyToOne(type => Contest, contest => contest.entries)
     contest: Contest;
 
-    @ManyToOne(type => ContestVote, vote => vote.contest)
+    @OneToMany(type => ContestVote, vote => vote.contest)
     votes: ContestVote[];
 }

+ 0 - 1
db/src/entity/ContestVote.ts

@@ -8,7 +8,6 @@ export class ContestVote {
     @PrimaryColumn()
     userId: string;
 
-    // :thonq
     @ManyToOne(type => Contest, contest => contest.votes, { primary: true })
     contest: Contest;