#32 subfleet classificiation scaffolding

This commit is contained in:
Nabeel Shahzad
2017-06-22 20:55:45 -05:00
parent 6bbb37061b
commit aaaead77a5
28 changed files with 493 additions and 348 deletions

View File

@@ -14,8 +14,10 @@ class CreateAircraftsTable extends Migration
$table->string('name');
$table->string('registration')->nullable();
$table->string('tail_number')->nullable();
$table->string('cargo_capacity')->nullable();
$table->string('fuel_capacity')->nullable();
$table->double('cargo_capacity', 19, 2)->nullable();
$table->double('fuel_capacity', 19, 2)->nullable();
$table->double('gross_weight', 19, 2)->nullable();
$table->tinyInteger('fuel_type')->unsigned()->nullable();
$table->boolean('active')->default(true);
$table->timestamps();
@@ -23,20 +25,10 @@ class CreateAircraftsTable extends Migration
$table->unique('registration');
});
Schema::create('aircraft_classes', function (Blueprint $table) {
$table->increments('id');
$table->string('code');
$table->string('name');
$table->string('notes')->nullable();
$table->timestamps();
$table->index('code');
});
}
public function down()
{
Schema::drop('aircraft');
Schema::drop('aircraft_classes');
}
}

View File

@@ -24,14 +24,6 @@ class CreateRanksTable extends Migration
$table->unique('name');
});
Schema::create('aircraft_rank', function(Blueprint $table) {
$table->increments('id');
$table->integer('aircraft_id')->unsigned();
$table->integer('rank_id')->unsigned();
$table->double('acars_pay', 19, 2)->default(0.0)->unsigned();
$table->double('manual_pay', 19, 2)->default(0.0)->unsigned();
});
}
/**
@@ -42,6 +34,5 @@ class CreateRanksTable extends Migration
public function down()
{
Schema::drop('ranks');
Schema::drop('aircraft_rank');
}
}

View File

@@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateSubfleetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('subfleets', function (Blueprint $table) {
$table->increments('id');
$table->integer('airline_id')->unsigned()->nullable();
$table->string('name');
$table->text('type');
$table->timestamps();
$table->softDeletes();
});
Schema::create('subfleet_rank', function(Blueprint $table) {
$table->increments('id');
$table->integer('subfleet_id')->unsigned()->nullable();
$table->integer('rank_id')->unsigned()->nullable();
$table->double('acars_pay', 19, 2)->unsigned()->nullable();
$table->double('manual_pay', 19, 2)->unsigned()->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('subfleets');
Schema::drop('subfleet_rank');
}
}

View File

@@ -70,42 +70,27 @@ airports:
lat: 51.4775
lon: -0.4614
#
aircraft_classes:
- id: 1
code: H
name: Heavy
- id: 2
code: M
name: Medium
- id: 3
code: L
name: Light
#
aircraft:
- id: 1
aircraft_class_id: 1
icao: B744
name: Boeing 747-400
registration: NC17
tail_number: 17
- id: 2
aircraft_class_id: 1
icao: B772
name: Boeing 777-200
registration: NC20
tail_number: 20
aircraft_rank:
- aircraft_id: 1
rank_id: 1
- aircraft_id: 1
rank_id: 2
acars_pay: 100
manual_pay: 50
#aircraft_rank:
# - aircraft_id: 1
# rank_id: 1
# - aircraft_id: 1
# rank_id: 2
# acars_pay: 100
# manual_pay: 50
#
fares:
- id: 1
code: Y