mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
fix: replace console messages with unified command.
This commit is contained in:
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands\System;
|
||||
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Console\Commands\VerifiesAccessToken;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use Illuminate\Console\Command;
|
||||
@@ -33,6 +34,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class ForceMigration extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
use VerifiesAccessToken;
|
||||
|
||||
/**
|
||||
@@ -58,13 +60,13 @@ class ForceMigration extends Command
|
||||
public function handle(): int
|
||||
{
|
||||
if (!$this->verifyAccessToken()) {
|
||||
$this->error('Invalid access token.');
|
||||
$this->friendlyError('Invalid access token.');
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
$this->error('Running this command is dangerous and can cause data loss.');
|
||||
$this->error('Please do not continue.');
|
||||
$this->friendlyError('Running this command is dangerous and can cause data loss.');
|
||||
$this->friendlyError('Please do not continue.');
|
||||
$question = $this->confirm('Do you want to continue?');
|
||||
if (true === $question) {
|
||||
$user = $this->getUser();
|
||||
@@ -80,16 +82,16 @@ class ForceMigration extends Command
|
||||
private function forceMigration(): void
|
||||
{
|
||||
DB::commit();
|
||||
$this->line('Dropping "migrations" table...');
|
||||
$this->friendlyLine('Dropping "migrations" table...');
|
||||
sleep(2);
|
||||
Schema::dropIfExists('migrations');
|
||||
$this->line('Re-run all migrations...');
|
||||
$this->friendlyLine('Re-run all migrations...');
|
||||
Artisan::call('migrate', ['--seed' => true]);
|
||||
sleep(2);
|
||||
$this->line('');
|
||||
$this->line('There is a good chance you just saw a lot of error messages.');
|
||||
$this->line('No need to panic yet. First try to access Firefly III (again).');
|
||||
$this->line('The issue, whatever it was, may have been solved now.');
|
||||
$this->line('');
|
||||
$this->friendlyLine('');
|
||||
$this->friendlyWarning('There is a good chance you just saw a lot of error messages.');
|
||||
$this->friendlyWarning('No need to panic yet. First try to access Firefly III (again).');
|
||||
$this->friendlyWarning('The issue, whatever it was, may have been solved now.');
|
||||
$this->friendlyLine('');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user