ContestVote.ts 590 B

123456789101112131415161718192021
  1. import { Contest } from "./Contest";
  2. import { ContestEntry } from "./ContestEntry";
  3. import { Entity, PrimaryColumn, ManyToOne, Column } from "typeorm";
  4. @Entity()
  5. export class ContestVote {
  6. @PrimaryColumn()
  7. userId: string;
  8. @PrimaryColumn()
  9. contestId: number;
  10. // @ManyToOne(type => Contest, contest => contest.votes, { primary: true })
  11. @ManyToOne("Contest", "votes", { primary: true })
  12. contest: Contest;
  13. // @ManyToOne(type => ContestEntry, entry => entry.votes)
  14. @ManyToOne("ContestEntry", "votes")
  15. contestEntry: ContestEntry;
  16. }