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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -33,6 +33,10 @@ return [
|
|||||||
'app_key' => env('PUSHER_APP_KEY'),
|
'app_key' => env('PUSHER_APP_KEY'),
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'migration' => [
|
||||||
|
'is_migration_enabled' => env('MIGRATION_ENABLED', true),
|
||||||
|
],
|
||||||
|
|
||||||
'horizon' => [
|
'horizon' => [
|
||||||
'is_horizon_enabled' => env('HORIZON_ENABLED', true),
|
'is_horizon_enabled' => env('HORIZON_ENABLED', true),
|
||||||
'is_scheduler_enabled' => env('SCHEDULER_ENABLED', true),
|
'is_scheduler_enabled' => env('SCHEDULER_ENABLED', true),
|
||||||
|
@@ -6,8 +6,6 @@ cd /var/www/html
|
|||||||
foreground {
|
foreground {
|
||||||
php
|
php
|
||||||
artisan
|
artisan
|
||||||
migrate
|
start:migration
|
||||||
--force
|
|
||||||
--isolated
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user