2020-10-12 20:51:35 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Console\Commands\Overrides;
|
|
|
|
|
|
|
|
use Pterodactyl\Console\RequiresDatabaseMigrations;
|
|
|
|
use Illuminate\Foundation\Console\UpCommand as BaseUpCommand;
|
|
|
|
|
|
|
|
class UpCommand extends BaseUpCommand
|
|
|
|
{
|
|
|
|
use RequiresDatabaseMigrations;
|
|
|
|
|
|
|
|
/**
|
2021-01-23 14:12:15 -08:00
|
|
|
* Block someone from running this up command if they have not completed
|
|
|
|
* the migration process.
|
2020-10-12 20:51:35 -07:00
|
|
|
*/
|
2022-10-14 10:59:20 -06:00
|
|
|
public function handle(): int
|
2020-10-12 20:51:35 -07:00
|
|
|
{
|
2021-01-23 12:33:34 -08:00
|
|
|
if (!$this->hasCompletedMigrations()) {
|
2021-01-23 15:52:57 -08:00
|
|
|
$this->showMigrationWarning();
|
|
|
|
|
2022-10-14 10:59:20 -06:00
|
|
|
return 1;
|
2020-10-12 20:51:35 -07:00
|
|
|
}
|
|
|
|
|
2022-10-21 13:31:59 -04:00
|
|
|
return parent::handle() ?? 0;
|
2020-10-12 20:51:35 -07:00
|
|
|
}
|
|
|
|
}
|