fix(backend): Update MikroORM, Fix voor 'pks not iterable' problem in Groups
This commit is contained in:
parent
451ac7546f
commit
9c638b11f6
5 changed files with 57 additions and 53 deletions
|
@ -35,5 +35,5 @@ export class Assignment {
|
|||
entity: () => Group,
|
||||
mappedBy: 'assignment',
|
||||
})
|
||||
groups!: Collection<Group>;
|
||||
groups: Collection<Group> = new Collection<Group>(this);
|
||||
}
|
||||
|
|
|
@ -7,15 +7,19 @@ import { GroupRepository } from '../../data/assignments/group-repository.js';
|
|||
repository: () => GroupRepository,
|
||||
})
|
||||
export class Group {
|
||||
@ManyToOne({
|
||||
entity: () => Assignment,
|
||||
primary: true,
|
||||
})
|
||||
assignment!: Assignment;
|
||||
|
||||
/*
|
||||
WARNING: Don't move the definition of groupNumber! If it does not come before the definition of assignment,
|
||||
creating groups fails because of a MikroORM bug!
|
||||
*/
|
||||
@PrimaryKey({ type: 'integer', autoincrement: true })
|
||||
groupNumber?: number;
|
||||
|
||||
@ManyToOne({
|
||||
entity: () => Assignment,
|
||||
primary: true
|
||||
})
|
||||
assignment!: Assignment;
|
||||
|
||||
@ManyToMany({
|
||||
entity: () => Student,
|
||||
owner: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue