mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 12:14:45 +02:00

* make sure migrations ran * add loading indicator to finish button * make error notification persistent * fix migration checker * cleanup traits
40 lines
1.3 KiB
PHP
40 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Traits\Commands;
|
|
|
|
use App\Traits\CheckMigrationsTrait;
|
|
use Illuminate\Console\Command;
|
|
|
|
/**
|
|
* @mixin Command
|
|
*/
|
|
trait RequiresDatabaseMigrations
|
|
{
|
|
use CheckMigrationsTrait;
|
|
|
|
/**
|
|
* Throw a massive error into the console to hopefully catch the users attention and get
|
|
* them to properly run the migrations rather than ignoring all of the other previous
|
|
* errors...
|
|
*/
|
|
protected function showMigrationWarning(): void
|
|
{
|
|
$this->getOutput()->writeln('<options=bold>
|
|
| @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
|
| |
|
|
| Your database has not been properly migrated! |
|
|
| |
|
|
| @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |</>
|
|
|
|
You must run the following command to finish migrating your database:
|
|
|
|
<fg=green;options=bold>php artisan migrate --step --force</>
|
|
|
|
You will not be able to use the Panel as expected without fixing your
|
|
database state by running the command above.
|
|
');
|
|
|
|
$this->getOutput()->error('You must correct the error above before continuing.');
|
|
}
|
|
}
|