Remove the flight_id column from the pireps table
This commit is contained in:
@@ -21,7 +21,6 @@ class CreatePirepTables extends Migration
|
|||||||
$table->unsignedInteger('user_id');
|
$table->unsignedInteger('user_id');
|
||||||
$table->unsignedInteger('airline_id');
|
$table->unsignedInteger('airline_id');
|
||||||
$table->unsignedInteger('aircraft_id')->nullable();
|
$table->unsignedInteger('aircraft_id')->nullable();
|
||||||
$table->string('flight_id', \App\Models\Flight::ID_MAX_LENGTH)->nullable();
|
|
||||||
$table->string('flight_number', 10)->nullable();
|
$table->string('flight_number', 10)->nullable();
|
||||||
$table->string('route_code', 5)->nullable();
|
$table->string('route_code', 5)->nullable();
|
||||||
$table->string('route_leg', 5)->nullable();
|
$table->string('route_leg', 5)->nullable();
|
||||||
@@ -47,7 +46,7 @@ class CreatePirepTables extends Migration
|
|||||||
|
|
||||||
$table->primary('id');
|
$table->primary('id');
|
||||||
$table->index('user_id');
|
$table->index('user_id');
|
||||||
$table->index('flight_id');
|
$table->index('flight_number');
|
||||||
$table->index('dpt_airport_id');
|
$table->index('dpt_airport_id');
|
||||||
$table->index('arr_airport_id');
|
$table->index('arr_airport_id');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ class FileRequest extends FormRequest
|
|||||||
|
|
||||||
'airline_id' => 'nullable|exists:airlines,id',
|
'airline_id' => 'nullable|exists:airlines,id',
|
||||||
'aircraft_id' => 'nullable|exists:aircraft,id',
|
'aircraft_id' => 'nullable|exists:aircraft,id',
|
||||||
'flight_id' => 'nullable|exists:flights,id',
|
|
||||||
'flight_number' => 'nullable',
|
'flight_number' => 'nullable',
|
||||||
'dpt_airport_id' => 'nullable',
|
'dpt_airport_id' => 'nullable',
|
||||||
'arr_airport_id' => 'nullable',
|
'arr_airport_id' => 'nullable',
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ class UpdateRequest extends FormRequest
|
|||||||
$rules = [
|
$rules = [
|
||||||
'airline_id' => 'nullable|exists:airlines,id',
|
'airline_id' => 'nullable|exists:airlines,id',
|
||||||
'aircraft_id' => 'nullable|exists:aircraft,id',
|
'aircraft_id' => 'nullable|exists:aircraft,id',
|
||||||
'flight_id' => 'nullable|exists:flights,id',
|
|
||||||
'flight_number' => 'nullable',
|
'flight_number' => 'nullable',
|
||||||
'dpt_airport_id' => 'nullable',
|
'dpt_airport_id' => 'nullable',
|
||||||
'arr_airport_id' => 'nullable',
|
'arr_airport_id' => 'nullable',
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ class Pirep extends BaseModel
|
|||||||
'user_id',
|
'user_id',
|
||||||
'airline_id',
|
'airline_id',
|
||||||
'aircraft_id',
|
'aircraft_id',
|
||||||
'flight_id',
|
|
||||||
'flight_number',
|
'flight_number',
|
||||||
'route_code',
|
'route_code',
|
||||||
'route_leg',
|
'route_leg',
|
||||||
@@ -293,11 +292,6 @@ class Pirep extends BaseModel
|
|||||||
return $this->hasMany(PirepFieldValues::class, 'pirep_id');
|
return $this->hasMany(PirepFieldValues::class, 'pirep_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function flight()
|
|
||||||
{
|
|
||||||
return $this->belongsTo(Flight::class, 'flight_id');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function pilot()
|
public function pilot()
|
||||||
{
|
{
|
||||||
return $this->user();
|
return $this->user();
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ class PirepRepository extends BaseRepository
|
|||||||
{
|
{
|
||||||
protected $fieldSearchable = [
|
protected $fieldSearchable = [
|
||||||
'user_id',
|
'user_id',
|
||||||
'flight_id',
|
|
||||||
'status',
|
'status',
|
||||||
'state',
|
'state',
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user