Add --force flag to migrations (#1203)

This commit is contained in:
Nabeel S
2021-05-24 10:58:10 -04:00
committed by GitHub
parent 4985da991b
commit 7d8a34645e
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ class MigrationService extends Service
// A little ugly, run the main migration first, this makes sure the migration table is there // A little ugly, run the main migration first, this makes sure the migration table is there
$output = ''; $output = '';
Artisan::call('migrate'); Artisan::call('migrate', ['--force' => true]);
$output .= trim(Artisan::output()); $output .= trim(Artisan::output());
// Then get any remaining migrations that are left over // Then get any remaining migrations that are left over
+3 -3
View File
@@ -126,7 +126,7 @@ class ModuleService extends Service
'enabled' => 1, 'enabled' => 1,
]); ]);
Artisan::call('module:migrate '.$module_name); Artisan::call('module:migrate '.$module_name, ['--force' => true]);
return true; return true;
} }
@@ -225,7 +225,7 @@ class ModuleService extends Service
} }
Artisan::call('config:cache'); Artisan::call('config:cache');
Artisan::call('module:migrate '.$module); Artisan::call('module:migrate '.$module, ['--force' => true]);
return flash()->success('Module Installed'); return flash()->success('Module Installed');
} }
@@ -246,7 +246,7 @@ class ModuleService extends Service
]); ]);
if ($status === true) { if ($status === true) {
Artisan::call('module:migrate '.$module->name); Artisan::call('module:migrate '.$module->name, ['--force' => true]);
} }
return true; return true;
+1 -1
View File
@@ -60,7 +60,7 @@ abstract class TestCase extends \Illuminate\Foundation\Testing\TestCase
Notification::fake(); Notification::fake();
Artisan::call('database:create', ['--reset' => true]); Artisan::call('database:create', ['--reset' => true]);
Artisan::call('migrate:refresh', ['--env' => 'testing']); Artisan::call('migrate:refresh', ['--env' => 'testing', '--force' => true]);
// $this->disableExceptionHandling(); // $this->disableExceptionHandling();
} }