diff --git a/app/Console/Commands/Migration.php b/app/Console/Commands/Migration.php new file mode 100644 index 000000000..58b94fd55 --- /dev/null +++ b/app/Console/Commands/Migration.php @@ -0,0 +1,24 @@ +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); + } + } +} diff --git a/config/constants.php b/config/constants.php index 4ea4411b6..3054df1f0 100644 --- a/config/constants.php +++ b/config/constants.php @@ -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), diff --git a/docker/production/etc/s6-overlay/s6-rc.d/db-migration/up b/docker/production/etc/s6-overlay/s6-rc.d/db-migration/up index f1a5006f1..c2548d136 100644 --- a/docker/production/etc/s6-overlay/s6-rc.d/db-migration/up +++ b/docker/production/etc/s6-overlay/s6-rc.d/db-migration/up @@ -6,8 +6,6 @@ cd /var/www/html foreground { php artisan - migrate - --force - --isolated + start:migration }