From 811ca51c4f591895e14e5e2829a09fa1cf62847a Mon Sep 17 00:00:00 2001 From: Ivan Nieto Vivanco Date: Thu, 17 Feb 2022 16:59:44 -0600 Subject: [PATCH] Wipe database before restoration --- app/Http/Controllers/SettingsController.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 28c56dabff..9fd4ace5e6 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -1202,11 +1202,10 @@ class SettingsController extends Controller // grab the user's info so we can make sure they exist in the system $user = User::find(Auth::user()->id); + // TODO: run a backup - // TODO: run a backup - - // TODO: add db:wipe + Artisan::call('db:wipe'); // run the restore command Artisan::call('snipeit:restore', @@ -1216,10 +1215,8 @@ class SettingsController extends Controller 'filename' => storage_path($path).'/'.$filename ]); - $output = Artisan::output(); - - // If it's greater than 300, it probably worked + $output = Artisan::output(); if (strlen($output) > 300) { \Auth::logout(); return redirect()->route('login')->with('success', 'Your system has been restored. Please login again.');