chore: cascade can replace set null action (#3812)
This commit is contained in:
parent
088f3977a2
commit
2195a31f5b
@ -52,11 +52,15 @@ 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']) {
|
||||||
throw new Error(
|
if (existReference.onDelete === 'SET NULL' && reference.onDelete === 'CASCADE') {
|
||||||
`On Delete Conflict, exist reference ${JSON.stringify(existReference)}, new reference ${JSON.stringify(
|
existReference.onDelete = reference.onDelete;
|
||||||
reference,
|
} else {
|
||||||
)}`,
|
throw new Error(
|
||||||
);
|
`On Delete Conflict, exist reference ${JSON.stringify(existReference)}, new reference ${JSON.stringify(
|
||||||
|
reference,
|
||||||
|
)}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user