mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-10-18 16:53:58 +00:00
Recover relationships after undoing table delete
This commit is contained in:
@@ -146,7 +146,8 @@ export default function ControlPanel({
|
||||
}
|
||||
} else if (a.action === Action.DELETE) {
|
||||
if (a.element === ObjectType.TABLE) {
|
||||
addTable(a.data, false);
|
||||
a.data.relationship.forEach((x) => addRelationship(x, false));
|
||||
addTable(a.data.table, false);
|
||||
} else if (a.element === ObjectType.RELATIONSHIP) {
|
||||
addRelationship(a.data, false);
|
||||
} else if (a.element === ObjectType.NOTE) {
|
||||
@@ -337,7 +338,7 @@ export default function ControlPanel({
|
||||
}
|
||||
} else if (a.action === Action.DELETE) {
|
||||
if (a.element === ObjectType.TABLE) {
|
||||
deleteTable(a.data.id, false);
|
||||
deleteTable(a.data.table.id, false);
|
||||
} else if (a.element === ObjectType.RELATIONSHIP) {
|
||||
deleteRelationship(a.data.id, false);
|
||||
} else if (a.element === ObjectType.NOTE) {
|
||||
|
||||
Reference in New Issue
Block a user