mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
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[] {
|
||||
const db = this.context.database;
|
||||
|
||||
const onDelete = this.options.onDelete || 'CASCADE';
|
||||
|
||||
return [
|
||||
BelongsToField.toReference(db, association.toSource, this.options.onDelete),
|
||||
BelongsToField.toReference(db, association.toTarget, this.options.onDelete),
|
||||
BelongsToField.toReference(db, association.toSource, onDelete),
|
||||
BelongsToField.toReference(db, association.toTarget, onDelete),
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user