Improved database mechanics in admin CP for server view

This commit is contained in:
Dane Everitt 2017-03-05 16:37:38 -05:00
parent 16aaf531d6
commit 32dec97e46
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
6 changed files with 357 additions and 119 deletions

View file

@ -745,10 +745,12 @@ class ServerRepository
// Delete Databases
// This is the one un-recoverable point where
// transactions will not save us.
$repository = new DatabaseRepository;
foreach (Models\Database::select('id')->where('server_id', $server->id)->get() as &$database) {
$repository->drop($database->id);
}
//
// @TODO: move to post-deletion event as a queued task!
// $repository = new DatabaseRepository;
// foreach (Models\Database::select('id')->where('server_id', $server->id)->get() as &$database) {
// $repository->drop($database->id);
// }
$server->node->guzzleClient([
'X-Access-Token' => $server->node->daemonSecret,