mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 11:56:29 +00:00
chore: cascade can replace set null action (#3812)
This commit is contained in:
parent
088f3977a2
commit
2195a31f5b
@ -52,6 +52,9 @@ class ReferencesMap {
|
|||||||
existReference.onDelete = reference.onDelete;
|
existReference.onDelete = reference.onDelete;
|
||||||
existReference.priority = reference.priority;
|
existReference.priority = reference.priority;
|
||||||
} else if (newPriority === existPriority && newPriority === PRIORITY_MAP['user']) {
|
} else if (newPriority === existPriority && newPriority === PRIORITY_MAP['user']) {
|
||||||
|
if (existReference.onDelete === 'SET NULL' && reference.onDelete === 'CASCADE') {
|
||||||
|
existReference.onDelete = reference.onDelete;
|
||||||
|
} else {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`On Delete Conflict, exist reference ${JSON.stringify(existReference)}, new reference ${JSON.stringify(
|
`On Delete Conflict, exist reference ${JSON.stringify(existReference)}, new reference ${JSON.stringify(
|
||||||
reference,
|
reference,
|
||||||
@ -59,6 +62,7 @@ class ReferencesMap {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!existReference) {
|
if (!existReference) {
|
||||||
this.map.set(reference.targetCollectionName, [
|
this.map.set(reference.targetCollectionName, [
|
||||||
|
Loading…
Reference in New Issue
Block a user