#32 assign aircraft to subfleets, and aircraft to subfleets

This commit is contained in:
Nabeel Shahzad
2017-06-23 17:33:18 -05:00
parent b9d49a4af9
commit c3e417429a
27 changed files with 113 additions and 158 deletions

View File

@@ -37,14 +37,6 @@ class CreateFlightsTable extends Migration
$table->index('dpt_airport_id');
$table->index('arr_airport_id');
});
Schema::create('flight_aircraft', function ($table) {
$table->uuid('flight_id');
$table->integer('aircraft_id')->unsigned();
$table->primary(['flight_id', 'aircraft_id']);
$table->index(['aircraft_id', 'flight_id']);
});
}
/**
@@ -55,6 +47,5 @@ class CreateFlightsTable extends Migration
public function down()
{
Schema::drop('flights');
Schema::drop('flight_aircraft');
}
}

View File

@@ -23,14 +23,22 @@ class CreateSubfleetsTable extends Migration
});
Schema::create('subfleet_rank', function(Blueprint $table) {
$table->integer('rank_id')->unsigned()->nullable();
$table->integer('subfleet_id')->unsigned()->nullable();
$table->integer('rank_id')->unsigned();
$table->integer('subfleet_id')->unsigned();
$table->double('acars_pay', 19, 2)->unsigned()->nullable();
$table->double('manual_pay', 19, 2)->unsigned()->nullable();
$table->primary(['rank_id', 'subfleet_id']);
$table->index(['subfleet_id', 'rank_id']);
});
Schema::create('subfleet_flight', function(Blueprint $table) {
$table->integer('subfleet_id')->unsigned();
$table->integer('flight_id')->unsigned();
$table->primary(['subfleet_id', 'flight_id']);
$table->index(['flight_id', 'subfleet_id']);
});
}
/**
@@ -42,5 +50,6 @@ class CreateSubfleetsTable extends Migration
{
Schema::drop('subfleets');
Schema::drop('subfleet_rank');
Schema::drop('subfleet_flight');
}
}

View File

@@ -73,11 +73,13 @@ airports:
#
aircraft:
- id: 1
subfleet_id: 1
icao: B744
name: Boeing 747-400
registration: NC17
tail_number: 17
- id: 2
subfleet_id: 2
icao: B772
name: Boeing 777-200
registration: NC20
@@ -139,6 +141,16 @@ flights:
arr_airport_id: 2
route: KAUS KJFK
flight_aircraft:
- flight_id: 1
aircraft_id: 1
subfleets:
- id: 1
airline_id: 1
name: 747-400 Winglets
type: 744W
- id: 2
airline_id: 1
name: 777-200 LR
type: 772-LR
subfleet_flight:
- subfleet_id: 1
flight_id: 1