force migration

added maintenance mode
This commit is contained in:
Peter Papp
2020-08-26 07:51:16 +02:00
parent 0d272bc9b7
commit ab6ff5dbfd
4 changed files with 32 additions and 4 deletions

View File

@@ -125,6 +125,28 @@ class UpgradeAppController extends Controller
return response('Done', 200);
}
/**
* Start maintenance mode
*/
public function up() {
$command = Artisan::call('up');
if ($command === 0) {
echo 'System is in production mode';
}
}
/**
* End maintenance mode
*/
public function down() {
$command = Artisan::call('down');
if ($command === 0) {
echo 'System is in maintenance mode';
}
}
/**
* Upgrade database
*/
@@ -137,7 +159,9 @@ class UpgradeAppController extends Controller
*/
if (! Schema::hasColumn('shares', 'expire_in')) {
$command = Artisan::call('migrate');
$command = Artisan::call('migrate', [
'--force' => true
]);
if ($command === 0) {
echo 'Operation was successful.';