rename flight subfleet join table

This commit is contained in:
Nabeel Shahzad
2018-03-20 16:11:24 -05:00
parent 9e43955fbb
commit 5d5565e5a8
4 changed files with 13 additions and 11 deletions

View File

@@ -73,6 +73,15 @@ class CreateFlightTables extends Migration
$table->index('flight_id');
});
Schema::create('flight_subfleet', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedInteger('subfleet_id');
$table->string('flight_id', \App\Interfaces\Model::ID_MAX_LENGTH);
$table->index(['subfleet_id', 'flight_id']);
$table->index(['flight_id', 'subfleet_id']);
});
}
/**
@@ -84,6 +93,7 @@ class CreateFlightTables extends Migration
{
Schema::drop('flight_fields');
Schema::drop('flight_fare');
Schema::drop('flight_subfleet');
Schema::drop('flights');
}
}

View File

@@ -35,14 +35,6 @@ class CreateSubfleetTables extends Migration
$table->index(['fare_id', 'subfleet_id']);
});
Schema::create('subfleet_flight', function (Blueprint $table) {
$table->unsignedInteger('subfleet_id');
$table->string('flight_id', 12);
$table->primary(['subfleet_id', 'flight_id']);
$table->index(['flight_id', 'subfleet_id']);
});
Schema::create('subfleet_rank', function (Blueprint $table) {
$table->unsignedInteger('rank_id');
$table->unsignedInteger('subfleet_id');
@@ -63,7 +55,6 @@ class CreateSubfleetTables extends Migration
{
Schema::dropIfExists('subfleets');
Schema::dropIfExists('subfleet_fare');
Schema::dropIfExists('subfleet_flight');
Schema::dropIfExists('subfleet_rank');
}
}