Fix for deleting flights when importing (#984)
This commit is contained in:
@@ -6,6 +6,8 @@ use App\Contracts\ImportExport;
|
||||
use App\Contracts\Service;
|
||||
use App\Models\Airport;
|
||||
use App\Models\Expense;
|
||||
use App\Models\Flight;
|
||||
use App\Models\FlightFieldValue;
|
||||
use App\Repositories\FlightRepository;
|
||||
use App\Services\ImportExport\AircraftImporter;
|
||||
use App\Services\ImportExport\AirportImporter;
|
||||
@@ -229,7 +231,8 @@ class ImportService extends Service
|
||||
public function importFlights($csv_file, bool $delete_previous = true)
|
||||
{
|
||||
if ($delete_previous) {
|
||||
// TODO: Delete all from: flights, flight_field_values
|
||||
Flight::truncate();
|
||||
FlightFieldValue::truncate();
|
||||
}
|
||||
|
||||
$importer = new FlightImporter();
|
||||
|
||||
Reference in New Issue
Block a user