From 0fbd8e5d6832e3a1468d1632563787eaedf4de1b Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Tue, 30 Jan 2018 11:09:59 -0600 Subject: [PATCH] Fix distance field types --- .../migrations/2017_06_28_195426_create_pirep_tables.php | 4 ++-- app/Models/Pirep.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Database/migrations/2017_06_28_195426_create_pirep_tables.php b/app/Database/migrations/2017_06_28_195426_create_pirep_tables.php index e7182171..d37f31d6 100644 --- a/app/Database/migrations/2017_06_28_195426_create_pirep_tables.php +++ b/app/Database/migrations/2017_06_28_195426_create_pirep_tables.php @@ -28,9 +28,9 @@ class CreatePirepTables extends Migration $table->string('route_leg', 5)->nullable(); $table->string('dpt_airport_id', 5); $table->string('arr_airport_id', 5); - $table->unsignedInteger('distance')->nullable(); - $table->unsignedInteger('planned_distance')->nullable(); $table->unsignedInteger('level')->nullable(); + $table->unsignedDecimal('distance')->nullable(); + $table->unsignedDecimal('planned_distance')->nullable(); $table->unsignedDecimal('flight_time', 19)->nullable(); $table->unsignedDecimal('planned_flight_time', 19)->nullable(); $table->unsignedDecimal('zfw', 19)->nullable(); diff --git a/app/Models/Pirep.php b/app/Models/Pirep.php index 5a660061..079394a1 100644 --- a/app/Models/Pirep.php +++ b/app/Models/Pirep.php @@ -61,7 +61,8 @@ class Pirep extends BaseModel 'planned_flight_time' => 'integer', 'level' => 'integer', 'altitude' => 'integer', - 'block_fuel' => 'float', + 'zfw' => 'float', + 'block_fuel' => 'float', 'gross_weight' => 'float', 'landing_rate' => 'float', 'flight_type' => 'integer', @@ -106,7 +107,7 @@ class Pirep extends BaseModel */ public function allowedUpdates() { - if ($this->state === PirepState::CANCELLED) { + if($this->state === PirepState::CANCELLED) { return false; }