diff --git a/database/migrations/2017_06_09_010621_create_aircrafts_table.php b/database/migrations/2017_06_09_010621_create_aircrafts_table.php index 8c93efe5..ae442b32 100644 --- a/database/migrations/2017_06_09_010621_create_aircrafts_table.php +++ b/database/migrations/2017_06_09_010621_create_aircrafts_table.php @@ -9,7 +9,7 @@ class CreateAircraftsTable extends Migration { Schema::create('aircraft', function (Blueprint $table) { $table->increments('id'); - $table->integer('subfleet_id')->unsigned()->nullable(); + $table->integer('subfleet_id')->unsigned(); $table->string('hex_code')->nullable(); $table->string('icao'); $table->string('name'); diff --git a/database/migrations/2017_06_23_011011_create_subfleets_table.php b/database/migrations/2017_06_23_011011_create_subfleets_table.php index 7ddf1f29..6fcac74d 100644 --- a/database/migrations/2017_06_23_011011_create_subfleets_table.php +++ b/database/migrations/2017_06_23_011011_create_subfleets_table.php @@ -22,6 +22,14 @@ class CreateSubfleetsTable extends Migration $table->softDeletes(); }); + 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']); + }); + Schema::create('subfleet_rank', function(Blueprint $table) { $table->integer('rank_id')->unsigned(); $table->integer('subfleet_id')->unsigned(); @@ -31,14 +39,6 @@ class CreateSubfleetsTable extends Migration $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']); - }); } /**