import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from "typeorm"; import { ContestEntry } from "./ContestEntry"; import { ContestVote } from "./ContestVote"; @Entity() export class Contest { @PrimaryGeneratedColumn() id: number; @Column() startDate: Date; @Column() endDate: Date; @Column() channel: string; @Column() announceWinners: boolean; @OneToMany(type => ContestEntry, entry => entry.contest) entries: ContestEntry[]; @OneToMany(type => ContestVote, vote => vote.contest) votes: ContestVote[]; }