diff --git a/app/Database/factories/AirportFactory.php b/app/Database/factories/AirportFactory.php index 5ec4c1ef..29085a2f 100644 --- a/app/Database/factories/AirportFactory.php +++ b/app/Database/factories/AirportFactory.php @@ -7,7 +7,7 @@ use Faker\Generator as Faker; */ $factory->define(App\Models\Airport::class, function (Faker $faker) { return [ - 'id' => function () { + 'id' => function () { $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; $string = ''; $max = strlen($characters) - 1; @@ -28,6 +28,7 @@ $factory->define(App\Models\Airport::class, function (Faker $faker) { 'timezone' => $faker->timezone, 'lat' => $faker->latitude, 'lon' => $faker->longitude, + 'hub' => false, 'ground_handling_cost' => $faker->randomFloat(2, 0, 500), 'fuel_100ll_cost' => $faker->randomFloat(2, 0, 100), 'fuel_jeta_cost' => $faker->randomFloat(2, 0, 100), diff --git a/app/Database/migrations/2017_06_11_135707_create_airports_table.php b/app/Database/migrations/2017_06_11_135707_create_airports_table.php index 04533fb1..6670f4ac 100644 --- a/app/Database/migrations/2017_06_11_135707_create_airports_table.php +++ b/app/Database/migrations/2017_06_11_135707_create_airports_table.php @@ -8,9 +8,9 @@ class CreateAirportsTable extends Migration public function up() { Schema::create('airports', function (Blueprint $table) { - $table->string('id', 5)->primary(); - $table->string('iata', 5)->nullable(); - $table->string('icao', 5); + $table->string('id', 4)->primary(); + $table->string('iata', 4)->nullable(); + $table->string('icao', 4); $table->string('name', 100); $table->string('location', 100)->nullable(); $table->string('country', 64)->nullable(); diff --git a/app/Database/migrations/2017_06_17_214650_create_flight_tables.php b/app/Database/migrations/2017_06_17_214650_create_flight_tables.php index d7e4c154..2b8b13d3 100644 --- a/app/Database/migrations/2017_06_17_214650_create_flight_tables.php +++ b/app/Database/migrations/2017_06_17_214650_create_flight_tables.php @@ -19,9 +19,9 @@ class CreateFlightTables extends Migration $table->unsignedInteger('flight_number'); $table->string('route_code', 5)->nullable(); $table->string('route_leg', 5)->nullable(); - $table->string('dpt_airport_id', 5); - $table->string('arr_airport_id', 5); - $table->string('alt_airport_id', 5)->nullable(); + $table->string('dpt_airport_id', 4); + $table->string('arr_airport_id', 4); + $table->string('alt_airport_id', 4)->nullable(); $table->string('dpt_time', 10)->nullable(); $table->string('arr_time', 10)->nullable(); $table->unsignedInteger('level')->nullable()->default(0); 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 b1a4b1b7..3cbaa259 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 @@ -24,8 +24,8 @@ class CreatePirepTables extends Migration $table->string('route_code', 5)->nullable(); $table->string('route_leg', 5)->nullable(); $table->char('flight_type', 1)->default(FlightType::SCHED_PAX); - $table->string('dpt_airport_id', 5); - $table->string('arr_airport_id', 5); + $table->string('dpt_airport_id', 4); + $table->string('arr_airport_id', 4); $table->unsignedInteger('level')->nullable(); $table->unsignedDecimal('distance')->nullable(); $table->unsignedDecimal('planned_distance')->nullable();