2017-06-18 06:25:36 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
|
|
|
class CreateFlightsTable extends Migration
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('flights', function (Blueprint $table) {
|
2017-06-23 10:44:49 +08:00
|
|
|
$table->uuid('id');
|
2017-06-18 06:25:36 +08:00
|
|
|
$table->integer('airline_id')->unsigned();
|
|
|
|
$table->text('flight_number');
|
2017-06-20 00:30:18 +08:00
|
|
|
$table->text('route_code')->nullable();
|
|
|
|
$table->text('route_leg')->nullable();
|
2017-06-18 06:25:36 +08:00
|
|
|
$table->integer('dpt_airport_id')->unsigned();
|
|
|
|
$table->integer('arr_airport_id')->unsigned();
|
2017-06-20 00:30:18 +08:00
|
|
|
$table->integer('alt_airport_id')->unsigned()->nullable();
|
|
|
|
$table->text('route')->nullable();
|
|
|
|
$table->text('dpt_time')->nullable();
|
|
|
|
$table->text('arr_time')->nullable();
|
|
|
|
$table->text('notes')->nullable();
|
|
|
|
$table->boolean('active')->default(true);
|
2017-06-18 06:25:36 +08:00
|
|
|
$table->timestamps();
|
2017-06-20 00:30:18 +08:00
|
|
|
|
2017-06-23 10:44:49 +08:00
|
|
|
$table->primary('id');
|
|
|
|
|
2017-06-20 00:30:18 +08:00
|
|
|
$table->unique('flight_number');
|
|
|
|
|
|
|
|
$table->index('flight_number');
|
|
|
|
$table->index('dpt_airport_id');
|
|
|
|
$table->index('arr_airport_id');
|
2017-06-18 06:25:36 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::drop('flights');
|
|
|
|
}
|
|
|
|
}
|