This commit is contained in:
Dane Everitt 2017-03-30 16:30:22 -04:00
parent da003efb03
commit 9106971565
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 6 additions and 12 deletions

View file

@ -277,13 +277,9 @@ class NodeRepository
throw new DisplayException('You cannot delete a node with servers currently attached to it.');
}
DB::beginTransaction();
try {
DB::transaction(function () use ($node) {
// Unlink Database Servers
Models\DatabaseServer::where('linked_node', $node->id)->update([
'linked_node' => null,
]);
Models\DatabaseHost::where('node_id', $node->id)->update(['node_id' => null]);
// Delete Allocations
Models\Allocation::where('node_id', $node->id)->delete();
@ -293,11 +289,6 @@ class NodeRepository
// Delete Node
$node->delete();
DB::commit();
} catch (\Exception $ex) {
DB::rollback();
throw $ex;
}
});
}
}