mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Wipe database before restoration
This commit is contained in:
parent
a71911eba2
commit
811ca51c4f
|
@ -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.');
|
||||
|
|
Loading…
Reference in a new issue