chore: set belongs to many on delete to cascade (#1311)
This commit is contained in:
parent
38b5974b90
commit
d317fa056a
@ -30,9 +30,11 @@ export class BelongsToManyField extends RelationField {
|
|||||||
references(association): Reference[] {
|
references(association): Reference[] {
|
||||||
const db = this.context.database;
|
const db = this.context.database;
|
||||||
|
|
||||||
|
const onDelete = this.options.onDelete || 'CASCADE';
|
||||||
|
|
||||||
return [
|
return [
|
||||||
BelongsToField.toReference(db, association.toSource, this.options.onDelete),
|
BelongsToField.toReference(db, association.toSource, onDelete),
|
||||||
BelongsToField.toReference(db, association.toTarget, this.options.onDelete),
|
BelongsToField.toReference(db, association.toTarget, onDelete),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user