Add fare type for pax/cargo/mixed flights #621 (#623)

This commit is contained in:
Nabeel S
2020-03-06 15:10:03 -05:00
committed by GitHub
parent 9f3ddd5dbd
commit 632c5782de
12 changed files with 150 additions and 46 deletions

View File

@@ -0,0 +1,34 @@
<?php
use App\Models\Enums\FareType;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class FaresAddType extends Migration
{
/**
* Add a `pilot_pay` column for a fixed amount to pay to a pilot for a flight
*/
public function up()
{
Schema::table('fares', function (Blueprint $table) {
$table->unsignedTinyInteger('type')
->default(FareType::PASSENGER)
->nullable()
->after('capacity');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('fares', function (Blueprint $table) {
$table->dropColumn('type');
});
}
}