do prod migration with custom command
This commit is contained in:
24
app/Console/Commands/Migration.php
Normal file
24
app/Console/Commands/Migration.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class Migration extends Command
|
||||
{
|
||||
protected $signature = 'start:migration';
|
||||
|
||||
protected $description = 'Start Migration';
|
||||
|
||||
public function handle()
|
||||
{
|
||||
if (config('constants.migration.is_migration_enabled')) {
|
||||
$this->info('Migration is enabled on this server.');
|
||||
$this->call('migrate --force --isolated');
|
||||
exit(0);
|
||||
} else {
|
||||
$this->info('Migration is disabled on this server.');
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user