Do not allow running the up or seed commands if migrations have not been run
This commit is contained in:
parent
d5f2242c89
commit
49ddd63dbd
3 changed files with 110 additions and 0 deletions
23
app/Console/Commands/Overrides/UpCommand.php
Normal file
23
app/Console/Commands/Overrides/UpCommand.php
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Console\Commands\Overrides;
|
||||
|
||||
use Pterodactyl\Console\RequiresDatabaseMigrations;
|
||||
use Illuminate\Foundation\Console\UpCommand as BaseUpCommand;
|
||||
|
||||
class UpCommand extends BaseUpCommand
|
||||
{
|
||||
use RequiresDatabaseMigrations;
|
||||
|
||||
/**
|
||||
* @return bool|int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
if (!$this->hasCompletedMigrations()) {
|
||||
return $this->showMigrationWarning();
|
||||
}
|
||||
|
||||
return parent::handle();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue