set fare classes on aircraft w/ overrides (no admin ui yet)
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
$factory->define(App\Models\Fare::class, function (Faker\Generator $faker) {
|
||||
return [
|
||||
|
||||
'code' => 'Y',
|
||||
'name' => 'Economy',
|
||||
'price' => '100',
|
||||
'capacity' => '200',
|
||||
];
|
||||
});
|
||||
|
||||
@@ -9,7 +9,7 @@ class CreateAircraftsTable extends Migration
|
||||
{
|
||||
Schema::create('aircraft', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('aircraft_class_id')->unsigned();
|
||||
$table->integer('aircraft_class_id')->unsigned()->nullable();
|
||||
$table->string('icao');
|
||||
$table->string('name');
|
||||
$table->string('full_name')->nullable();
|
||||
|
||||
51
database/migrations/2017_06_10_040335_create_fares_table.php
Normal file
51
database/migrations/2017_06_10_040335_create_fares_table.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateFaresTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('fares', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('code');
|
||||
$table->string('name');
|
||||
$table->float('price');
|
||||
$table->float('cost')->default(0.0);
|
||||
$table->integer('capacity')->default(0);
|
||||
$table->string('notes')->nullable();
|
||||
$table->boolean('active')->default(true);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
|
||||
Schema::create('aircraft_fare', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('aircraft_id');
|
||||
$table->integer('fare_id');
|
||||
$table->float('price')->nullable();
|
||||
$table->float('cost')->nullable();
|
||||
$table->float('capacity')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('fares');
|
||||
Schema::drop('aircraft_fare');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user