2020-10-12 20:51:35 -07:00
|
|
|
<?php
|
|
|
|
|
|
2024-08-09 08:23:03 +02:00
|
|
|
namespace App\Traits\Commands;
|
|
|
|
|
|
|
|
|
|
use App\Traits\CheckMigrationsTrait;
|
|
|
|
|
use Illuminate\Console\Command;
|
2020-10-12 20:51:35 -07:00
|
|
|
|
|
|
|
|
/**
|
2024-08-09 08:23:03 +02:00
|
|
|
* @mixin Command
|
2020-10-12 20:51:35 -07:00
|
|
|
*/
|
|
|
|
|
trait RequiresDatabaseMigrations
|
|
|
|
|
{
|
2024-08-09 08:23:03 +02:00
|
|
|
use CheckMigrationsTrait;
|
2020-10-12 20:51:35 -07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Throw a massive error into the console to hopefully catch the users attention and get
|
2025-03-03 14:41:19 -05:00
|
|
|
* them to properly run the migrations rather than ignoring other previous
|
2020-10-12 20:51:35 -07:00
|
|
|
* errors...
|
|
|
|
|
*/
|
2022-10-14 10:59:20 -06:00
|
|
|
protected function showMigrationWarning(): void
|
2020-10-12 20:51:35 -07:00
|
|
|
{
|
2021-01-23 12:09:16 -08:00
|
|
|
$this->getOutput()->writeln('<options=bold>
|
2020-10-12 20:51:35 -07:00
|
|
|
| @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
|
|
|
|
|
| |
|
|
|
|
|
| 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</>
|
|
|
|
|
|
2024-03-12 22:39:16 -04:00
|
|
|
You will not be able to use the Panel as expected without fixing your
|
2020-10-12 20:51:35 -07:00
|
|
|
database state by running the command above.
|
2021-01-23 12:09:16 -08:00
|
|
|
');
|
2020-10-12 20:51:35 -07:00
|
|
|
|
2021-01-23 12:09:16 -08:00
|
|
|
$this->getOutput()->error('You must correct the error above before continuing.');
|
2020-10-12 20:51:35 -07:00
|
|
|
}
|
|
|
|
|
}
|