flight search and pagination (in admin), schema changes to accomodate

This commit is contained in:
Nabeel Shahzad
2017-11-30 20:28:45 -06:00
parent a82b8878d3
commit e1b0b92f83
30 changed files with 554 additions and 104 deletions

View File

@@ -20,8 +20,8 @@ class CreateUsersTable extends Migration
$table->string('password');
$table->integer('airline_id')->nullable()->unsigned();
$table->integer('rank_id')->nullable()->unsigned();
$table->integer('home_airport_id')->nullable()->unsigned();
$table->integer('curr_airport_id')->nullable()->unsigned();
$table->string('home_airport_id', 5)->nullable();
$table->string('curr_airport_id', 5)->nullable();
$table->uuid('last_pirep_id')->nullable();
$table->bigInteger('flights')->unsigned()->default(0);
$table->bigInteger('flight_time')->unsigned()->default(0);

View File

@@ -10,7 +10,7 @@ class CreateAircraftsTable extends Migration
Schema::create('aircraft', function (Blueprint $table) {
$table->increments('id');
$table->integer('subfleet_id')->unsigned();
$table->integer('airport_id')->unsigned()->nullable();
$table->string('airport_id', 5)->nullable();
$table->string('hex_code', 10)->nullable();
$table->string('name', 50);
$table->string('registration', 10)->nullable();

View File

@@ -14,19 +14,17 @@ class CreateAirportsTable extends Migration
public function up()
{
Schema::create('airports', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('icao', 5)->unique();
// $table->bigIncrements('id');
$table->string('id', 5)->primary();
$table->string('icao', 5);
$table->string('name', 50);
$table->string('location', 50)->nullable();
$table->string('country', 50)->nullable();
$table->double('fuel_100ll_cost', 19, 2)->default(0);
$table->double('fuel_jeta_cost', 19, 2)->default(0);
$table->double('fuel_mogas_cost', 19, 2)->default(0);
$table->float('lat', 7, 4)->default(0.0);
$table->float('lon', 7, 4)->default(0.0);
$table->timestamps();
$table->index('icao');
$table->float('lat', 7, 4)->default(0.0)->nullable();
$table->float('lon', 7, 4)->default(0.0)->nullable();
});
}

View File

@@ -19,9 +19,9 @@ class CreateFlightsTable extends Migration
$table->string('flight_number', 10);
$table->string('route_code', 5)->nullable();
$table->string('route_leg', 5)->nullable();
$table->integer('dpt_airport_id')->unsigned();
$table->integer('arr_airport_id')->unsigned();
$table->integer('alt_airport_id')->unsigned()->nullable();
$table->string('dpt_airport_id', 5);
$table->string('arr_airport_id', 5);
$table->string('alt_airport_id', 5)->nullable();
$table->text('route')->nullable();
$table->text('dpt_time', 10)->nullable();
$table->text('arr_time', 10)->nullable();

View File

@@ -22,8 +22,8 @@ class CreatePirepsTable extends Migration
$table->string('flight_number', 10)->nullable();
$table->string('route_code', 5)->nullable();
$table->string('route_leg', 5)->nullable();
$table->integer('dpt_airport_id')->unsigned();
$table->integer('arr_airport_id')->unsigned();
$table->string('dpt_airport_id', 5)->unsigned();
$table->string('arr_airport_id', 5)->unsigned();
$table->double('flight_time', 19, 2)->unsigned();
$table->double('gross_weight', 19, 2)->nullable();
$table->double('fuel_used', 19, 2)->nullable();