#32 moved fares to subfleets
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -110,29 +110,6 @@ fares:
|
||||
price: 800
|
||||
capacity: 5
|
||||
|
||||
# add a few mods to aircraft and fares
|
||||
aircraft_fare:
|
||||
|
||||
# Fare classes on the 747
|
||||
- aircraft_id: 1
|
||||
fare_id: 1
|
||||
price: 200
|
||||
capacity: 400
|
||||
- aircraft_id: 1
|
||||
fare_id: 2
|
||||
capacity: 20
|
||||
- aircraft_id: 1
|
||||
fare_id: 3
|
||||
price: 1000
|
||||
capacity: 10
|
||||
|
||||
# Fare classes on the 777
|
||||
- aircraft_id: 2
|
||||
fare_id: 1
|
||||
- aircraft_id: 2
|
||||
fare_id: 3
|
||||
capacity: 10
|
||||
|
||||
flights:
|
||||
- id: 1
|
||||
airline_id: 1
|
||||
@@ -151,6 +128,29 @@ subfleets:
|
||||
name: 777-200 LR
|
||||
type: 772-LR
|
||||
|
||||
# add a few mods to aircraft and fares
|
||||
subfleet_fare:
|
||||
|
||||
# Fare classes on the 747
|
||||
- subfleet_id: 1
|
||||
fare_id: 1
|
||||
price: 200
|
||||
capacity: 400
|
||||
- subfleet_id: 1
|
||||
fare_id: 2
|
||||
capacity: 20
|
||||
- subfleet_id: 1
|
||||
fare_id: 3
|
||||
price: 1000
|
||||
capacity: 10
|
||||
|
||||
# Fare classes on the 777
|
||||
- subfleet_id: 2
|
||||
fare_id: 1
|
||||
- subfleet_id: 2
|
||||
fare_id: 3
|
||||
capacity: 10
|
||||
|
||||
subfleet_flight:
|
||||
- subfleet_id: 1
|
||||
flight_id: 1
|
||||
|
||||
Reference in New Issue
Block a user