From f2b216c404743e6f280d51943f4dfbde2c5fd78e Mon Sep 17 00:00:00 2001 From: Nabeel S Date: Wed, 26 Feb 2020 17:06:39 -0500 Subject: [PATCH] Remove 4 char restriction from ICAO; use decimal type for lat/lon #590 (#591) * Remove 4 char restriction from ICAO; use decimal type for lat/lon #590 * Reorder imports --- ..._26_044305_modify_airports_coordinates.php | 37 +++++++++++++++++++ app/Models/Airport.php | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 app/Database/migrations/2020_02_26_044305_modify_airports_coordinates.php diff --git a/app/Database/migrations/2020_02_26_044305_modify_airports_coordinates.php b/app/Database/migrations/2020_02_26_044305_modify_airports_coordinates.php new file mode 100644 index 00000000..4803b41c --- /dev/null +++ b/app/Database/migrations/2020_02_26_044305_modify_airports_coordinates.php @@ -0,0 +1,37 @@ +decimal('lat', 10, 5)->change()->default(0.0)->nullable(); + $table->decimal('lon', 11, 5)->change()->default(0.0)->nullable(); + }); + + Schema::table('airports', function ($table) { + $table->decimal('lat', 10, 5)->change()->default(0.0)->nullable(); + $table->decimal('lon', 11, 5)->change()->default(0.0)->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + } +} diff --git a/app/Models/Airport.php b/app/Models/Airport.php index 4562e090..c200afb1 100644 --- a/app/Models/Airport.php +++ b/app/Models/Airport.php @@ -66,7 +66,7 @@ class Airport extends Model * Validation rules */ public static $rules = [ - 'icao' => 'required|size:4', + 'icao' => 'required', 'iata' => 'sometimes|nullable', 'name' => 'required', 'location' => 'sometimes',