fix: cascade bij group entity
This commit is contained in:
parent
bb3a242bf9
commit
7823c45851
1 changed files with 2 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
import { Collection, Entity, ManyToMany, ManyToOne, PrimaryKey } from '@mikro-orm/core';
|
import {Cascade, Collection, Entity, ManyToMany, ManyToOne, PrimaryKey} from '@mikro-orm/core';
|
||||||
import { Assignment } from './assignment.entity.js';
|
import { Assignment } from './assignment.entity.js';
|
||||||
import { Student } from '../users/student.entity.js';
|
import { Student } from '../users/student.entity.js';
|
||||||
import { GroupRepository } from '../../data/assignments/group-repository.js';
|
import { GroupRepository } from '../../data/assignments/group-repository.js';
|
||||||
|
@ -24,6 +24,7 @@ export class Group {
|
||||||
entity: () => Student,
|
entity: () => Student,
|
||||||
owner: true,
|
owner: true,
|
||||||
inversedBy: 'groups',
|
inversedBy: 'groups',
|
||||||
|
cascade: [Cascade.ALL],
|
||||||
})
|
})
|
||||||
members: Collection<Student> = new Collection<Student>(this);
|
members: Collection<Student> = new Collection<Student>(this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue