diff --git a/src/task/task.entity.ts b/src/task/task.entity.ts index 1e7470102800e44bb60d68d73340eedb67e8b93e..e6fd61879325993ff34609d7e0b15f5dd89dfc18 100644 --- a/src/task/task.entity.ts +++ b/src/task/task.entity.ts @@ -1,15 +1,25 @@ -import { PrimaryGeneratedColumn, Column, Entity, ManyToOne } from 'typeorm'; +import { + PrimaryGeneratedColumn, + Column, + Entity, + ManyToOne, + JoinColumn, +} from 'typeorm'; import { FactionEntity } from 'src/game/faction.entity'; +import { GameEntity } from 'src/game/game.entity'; @Entity('Task') export class TaskEntity { @PrimaryGeneratedColumn('uuid') taskId: string; @Column({ type: 'text' }) taskName: string; @Column({ type: 'text' }) taskDescription: string; - @Column({ type: 'float' }) taskScore: number; - @Column({ type: 'text' }) taskWinner: string; @Column({ type: 'bool' }) taskIsActive: boolean; @ManyToOne(type => FactionEntity, faction => faction.factionId) faction: FactionEntity; + @ManyToOne(type => FactionEntity, faction => faction.factionId) + taskWinner: FactionEntity; + @ManyToOne(type => GameEntity, game => game.id) + @JoinColumn({ name: 'taskGame' }) + taskGame: GameEntity; }