mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -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
|
// grab the user's info so we can make sure they exist in the system
|
||||||
$user = User::find(Auth::user()->id);
|
$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
|
// run the restore command
|
||||||
Artisan::call('snipeit:restore',
|
Artisan::call('snipeit:restore',
|
||||||
|
@ -1216,10 +1215,8 @@ class SettingsController extends Controller
|
||||||
'filename' => storage_path($path).'/'.$filename
|
'filename' => storage_path($path).'/'.$filename
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$output = Artisan::output();
|
|
||||||
|
|
||||||
|
|
||||||
// If it's greater than 300, it probably worked
|
// If it's greater than 300, it probably worked
|
||||||
|
$output = Artisan::output();
|
||||||
if (strlen($output) > 300) {
|
if (strlen($output) > 300) {
|
||||||
\Auth::logout();
|
\Auth::logout();
|
||||||
return redirect()->route('login')->with('success', 'Your system has been restored. Please login again.');
|
return redirect()->route('login')->with('success', 'Your system has been restored. Please login again.');
|
||||||
|
|
Loading…
Reference in a new issue