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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

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
$output = '';
Artisan::call('migrate');
Artisan::call('migrate', ['--force' => true]);
$output .= trim(Artisan::output());
// Then get any remaining migrations that are left over

View File

@ -126,7 +126,7 @@ class ModuleService extends Service
'enabled' => 1,
]);
Artisan::call('module:migrate '.$module_name);
Artisan::call('module:migrate '.$module_name, ['--force' => true]);
return true;
}
@ -225,7 +225,7 @@ class ModuleService extends Service
}
Artisan::call('config:cache');
Artisan::call('module:migrate '.$module);
Artisan::call('module:migrate '.$module, ['--force' => true]);
return flash()->success('Module Installed');
}
@ -246,7 +246,7 @@ class ModuleService extends Service
]);
if ($status === true) {
Artisan::call('module:migrate '.$module->name);
Artisan::call('module:migrate '.$module->name, ['--force' => true]);
}
return true;

View File

@ -60,7 +60,7 @@ abstract class TestCase extends \Illuminate\Foundation\Testing\TestCase
Notification::fake();
Artisan::call('database:create', ['--reset' => true]);
Artisan::call('migrate:refresh', ['--env' => 'testing']);
Artisan::call('migrate:refresh', ['--env' => 'testing', '--force' => true]);
// $this->disableExceptionHandling();
}