ContestEntry.ts 398 B

12345678910111213141516
  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. contest: Contest;
  10. @OneToMany(type => ContestVote, vote => vote.contest)
  11. votes: ContestVote[];
  12. }