Change flight_number field to uint
This commit is contained in:
@@ -16,7 +16,7 @@ class CreateFlightTables extends Migration
|
|||||||
Schema::create('flights', function (Blueprint $table) {
|
Schema::create('flights', function (Blueprint $table) {
|
||||||
$table->string('id', \App\Interfaces\Model::ID_MAX_LENGTH);
|
$table->string('id', \App\Interfaces\Model::ID_MAX_LENGTH);
|
||||||
$table->unsignedInteger('airline_id');
|
$table->unsignedInteger('airline_id');
|
||||||
$table->string('flight_number', 10);
|
$table->unsignedInteger('flight_number');
|
||||||
$table->string('route_code', 5)->nullable();
|
$table->string('route_code', 5)->nullable();
|
||||||
$table->string('route_leg', 5)->nullable();
|
$table->string('route_leg', 5)->nullable();
|
||||||
$table->string('dpt_airport_id', 5);
|
$table->string('dpt_airport_id', 5);
|
||||||
|
|||||||
@@ -102,6 +102,11 @@ class ImportService extends Service
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// turn it into a collection and run some filtering
|
||||||
|
$row = collect($row)->map(function ($val, $index) {
|
||||||
|
return trim($val);
|
||||||
|
})->toArray();
|
||||||
|
|
||||||
$importer->import($row, $offset);
|
$importer->import($row, $offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user