* Remove 4 char restriction from ICAO; use decimal type for lat/lon #590 * Reorder imports
This commit is contained in:
parent
14aacdfb75
commit
f2b216c404
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn the airport coordinates and other lat/lon coords into decimal type
|
||||||
|
*/
|
||||||
|
class ModifyAirportsCoordinates extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('acars', function ($table) {
|
||||||
|
$table->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()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -66,7 +66,7 @@ class Airport extends Model
|
|||||||
* Validation rules
|
* Validation rules
|
||||||
*/
|
*/
|
||||||
public static $rules = [
|
public static $rules = [
|
||||||
'icao' => 'required|size:4',
|
'icao' => 'required',
|
||||||
'iata' => 'sometimes|nullable',
|
'iata' => 'sometimes|nullable',
|
||||||
'name' => 'required',
|
'name' => 'required',
|
||||||
'location' => 'sometimes',
|
'location' => 'sometimes',
|
||||||
|
Loading…
Reference in New Issue
Block a user