#32 moved fares to subfleets

This commit is contained in:
Nabeel Shahzad
2017-06-24 11:09:27 -05:00
parent ca74afacd8
commit 3736e530bf
15 changed files with 216 additions and 144 deletions

View File

@@ -24,18 +24,6 @@ class CreateFaresTable extends Migration
$table->boolean('active')->default(true);
$table->timestamps();
});
Schema::create('aircraft_fare', function (Blueprint $table) {
$table->integer('aircraft_id')->unsigned();
$table->integer('fare_id')->unsigned();
$table->decimal('price', 19, 2)->nullable();
$table->decimal('cost', 19, 2)->nullable();
$table->integer('capacity')->nullable()->unsigned();
$table->timestamps();
$table->primary(['aircraft_id', 'fare_id']);
$table->index(['fare_id', 'aircraft_id']);
});
}
/**
@@ -46,6 +34,5 @@ class CreateFaresTable extends Migration
public function down()
{
Schema::drop('fares');
Schema::drop('aircraft_fare');
}
}

View File

@@ -22,6 +22,18 @@ class CreateSubfleetsTable extends Migration
$table->softDeletes();
});
Schema::create('subfleet_fare', function (Blueprint $table) {
$table->integer('subfleet_id')->unsigned();
$table->integer('fare_id')->unsigned();
$table->decimal('price', 19, 2)->nullable();
$table->decimal('cost', 19, 2)->nullable();
$table->integer('capacity')->nullable()->unsigned();
$table->timestamps();
$table->primary(['subfleet_id', 'fare_id']);
$table->index(['fare_id', 'subfleet_id']);
});
Schema::create('subfleet_flight', function(Blueprint $table) {
$table->integer('subfleet_id')->unsigned();
$table->integer('flight_id')->unsigned();