do prod migration with custom command

This commit is contained in:
Andras Bacsai
2024-12-11 17:01:06 +01:00
parent 1908d8a180
commit a5b48caeb9
3 changed files with 29 additions and 3 deletions

View 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);
}
}
}

View File

@@ -33,6 +33,10 @@ return [
'app_key' => env('PUSHER_APP_KEY'),
],
'migration' => [
'is_migration_enabled' => env('MIGRATION_ENABLED', true),
],
'horizon' => [
'is_horizon_enabled' => env('HORIZON_ENABLED', true),
'is_scheduler_enabled' => env('SCHEDULER_ENABLED', true),

View File

@@ -6,8 +6,6 @@ cd /var/www/html
foreground {
php
artisan
migrate
--force
--isolated
start:migration
}