Coding task · NestJS course · Module 3: TypeORM and Databases

OneToMany and ManyToOne relation

Create a relation between Legion and Legionary - one legion has many legionaries.

Task

Write Legion entity with @OneToMany(() => Legionary, ...) and Legionary entity with @ManyToOne(() => Legion, ...)