ContestEntry.ts 509 B

123456789101112131415161718
  1. import {Entity, PrimaryColumn, ManyToOne, OneToMany} from "typeorm";
  2. import {Contest} from "./Contest";
  3. import { ContestVote } from "./ContestVote";
  4. @Entity()
  5. export class ContestEntry {
  6. @PrimaryColumn()
  7. msgId: string;
  8. // @ManyToOne(type => Contest, contest => contest.entries)
  9. @ManyToOne("Contest", "entries")
  10. contest: Contest;
  11. // @OneToMany(type => ContestVote, vote => vote.contestEntry)
  12. @OneToMany("ContestVote", "contestEntry")
  13. votes: ContestVote[];
  14. }