Cleanup some PIREP fields

This commit is contained in:
Nabeel Shahzad
2018-01-30 11:15:07 -06:00
parent 0fbd8e5d68
commit af4c9cd973
2 changed files with 11 additions and 16 deletions

View File

@@ -45,7 +45,6 @@ class CreatePirepTables extends Migration
$table->tinyInteger('status')->default(PirepStatus::SCHEDULED); $table->tinyInteger('status')->default(PirepStatus::SCHEDULED);
$table->longText('raw_data')->nullable(); $table->longText('raw_data')->nullable();
$table->timestamps(); $table->timestamps();
$table->softDeletes();
$table->primary('id'); $table->primary('id');
$table->index('user_id'); $table->index('user_id');

View File

@@ -5,7 +5,6 @@ namespace App\Models;
use App\Models\Enums\AcarsType; use App\Models\Enums\AcarsType;
use App\Models\Enums\PirepState; use App\Models\Enums\PirepState;
use App\Models\Traits\HashId; use App\Models\Traits\HashId;
use Illuminate\Database\Eloquent\SoftDeletes;
/** /**
* Class Pirep * Class Pirep
@@ -15,39 +14,36 @@ use Illuminate\Database\Eloquent\SoftDeletes;
class Pirep extends BaseModel class Pirep extends BaseModel
{ {
use HashId; use HashId;
use SoftDeletes;
public $table = 'pireps'; public $table = 'pireps';
public $incrementing = false; public $incrementing = false;
protected $dates = ['deleted_at'];
public $fillable = [ public $fillable = [
'id', 'id',
'user_id', 'user_id',
'airline_id',
'aircraft_id',
'flight_id', 'flight_id',
'flight_number', 'flight_number',
'route_code', 'route_code',
'route_leg', 'route_leg',
'airline_id', 'dpt_airport_id',
'aircraft_id', 'arr_airport_id',
'level',
'distance', 'distance',
'planned_distance', 'planned_distance',
'flight_time', 'flight_time',
'planned_flight_time', 'planned_flight_time',
'dpt_airport_id',
'arr_airport_id',
'zfw', 'zfw',
'block_fuel', 'block_fuel',
'landing_rate', 'landing_rate',
'level',
'route', 'route',
'notes', 'notes',
'source',
'source_name',
'flight_type', 'flight_type',
'state', 'state',
'status', 'status',
'source',
'source_name',
'raw_data', 'raw_data',
'created_at', 'created_at',
'updated_at', 'updated_at',
@@ -55,18 +51,18 @@ class Pirep extends BaseModel
protected $casts = [ protected $casts = [
'user_id' => 'integer', 'user_id' => 'integer',
'airline_id' => 'integer',
'aircraft_id' => 'integer',
'level' => 'integer',
'distance' => 'float', 'distance' => 'float',
'planned_distance' => 'float', 'planned_distance' => 'float',
'flight_time' => 'integer', 'flight_time' => 'integer',
'planned_flight_time' => 'integer', 'planned_flight_time' => 'integer',
'level' => 'integer',
'altitude' => 'integer',
'zfw' => 'float', 'zfw' => 'float',
'block_fuel' => 'float', 'block_fuel' => 'float',
'gross_weight' => 'float',
'landing_rate' => 'float', 'landing_rate' => 'float',
'flight_type' => 'integer',
'source' => 'integer', 'source' => 'integer',
'flight_type' => 'integer',
'state' => 'integer', 'state' => 'integer',
'status' => 'integer', 'status' => 'integer',
]; ];