mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 09:18:54 +00:00
42 lines
857 B
PHP
42 lines
857 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use Illuminate\Console\Command;
|
|
|
|
class UpdateNNTmuxDB extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'nntmux:db';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Update NNTmux database with new patches';
|
|
|
|
/**
|
|
* Create a new command instance.
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
public function handle(): void
|
|
{
|
|
// also prevent web access.
|
|
$this->output->writeln('<info>Updating database</info>');
|
|
if (config('app.env') !== 'production') {
|
|
$this->call('migrate');
|
|
} else {
|
|
$this->call('migrate', ['--force' => true]);
|
|
}
|
|
}
|
|
}
|