From 41bd325f9a52d49edaaa0bffc9aefd0b9b3fe9c0 Mon Sep 17 00:00:00 2001 From: Nabeel S Date: Sun, 30 Oct 2022 22:58:26 -0400 Subject: [PATCH] Revert "Bug fix #1414 (#1487)" (#1492) This reverts commit b4311b861fba6695407322dd62af93013ed67b35. --- app/Services/ImportExport/FlightImporter.php | 20 ++++---------------- app/Services/ModuleService.php | 6 +++--- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/app/Services/ImportExport/FlightImporter.php b/app/Services/ImportExport/FlightImporter.php index ae1cef2c..da5de9d1 100644 --- a/app/Services/ImportExport/FlightImporter.php +++ b/app/Services/ImportExport/FlightImporter.php @@ -124,22 +124,10 @@ class FlightImporter extends ImportExport } // Create/check that they exist - $process_dep = $this->processAirport($row['dpt_airport']); - if (is_null($process_dep)) { - $this->log('Could not import row '.$index.'. Departure Airport not found!'); - return false; - } - $process_arr = $this->processAirport($row['arr_airport']); - if (is_null($process_arr)) { - $this->log('Could not import row '.$index.'. Arrival Airport not found!'); - return false; - } + $this->processAirport($row['dpt_airport']); + $this->processAirport($row['arr_airport']); if ($row['alt_airport']) { - $process_alt = $this->processAirport($row['alt_airport']); - if (is_null($process_alt)) { - $this->log('Could not import row '.$index.'. Alternate Airport not found!'); - return false; - } + $this->processAirport($row['alt_airport']); } // Check/calculate the distance @@ -210,7 +198,7 @@ class FlightImporter extends ImportExport * * @return Airport */ - protected function processAirport($airport): Airport|null + protected function processAirport($airport): Airport { return $this->airportSvc->lookupAirportIfNotFound($airport); } diff --git a/app/Services/ModuleService.php b/app/Services/ModuleService.php index 930145d4..c15a7a1d 100644 --- a/app/Services/ModuleService.php +++ b/app/Services/ModuleService.php @@ -170,7 +170,7 @@ class ModuleService extends Service ]); try { - Artisan::call('module:migrate '.$module_name); + Artisan::call('module:migrate '.$module_name, ['--force' => true]); } catch (Exception $e) { Log::error('Error running migration for '.$module_name.'; error='.$e); } @@ -269,7 +269,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'); } @@ -290,7 +290,7 @@ class ModuleService extends Service ]); if ($status === true) { - Artisan::call('module:migrate '.$module->name); + Artisan::call('module:migrate '.$module->name, ['--force' => true]); } return true;