2017-06-09 09:37:51 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
|
|
|
class CreateAircraftsTable extends Migration
|
|
|
|
{
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('aircraft', function (Blueprint $table) {
|
|
|
|
$table->increments('id');
|
2017-06-24 06:37:51 +08:00
|
|
|
$table->integer('subfleet_id')->unsigned();
|
2017-06-25 03:00:56 +08:00
|
|
|
$table->integer('airport_id')->unsigned()->nullable();
|
2017-06-23 09:57:09 +08:00
|
|
|
$table->string('hex_code')->nullable();
|
2017-06-09 09:37:51 +08:00
|
|
|
$table->string('name');
|
|
|
|
$table->string('registration')->nullable();
|
2017-06-10 11:19:17 +08:00
|
|
|
$table->string('tail_number')->nullable();
|
|
|
|
$table->boolean('active')->default(true);
|
2017-06-09 09:37:51 +08:00
|
|
|
$table->timestamps();
|
2017-06-10 11:19:17 +08:00
|
|
|
|
|
|
|
$table->index('icao');
|
|
|
|
$table->unique('registration');
|
|
|
|
});
|
|
|
|
|
2017-06-09 09:37:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::drop('aircraft');
|
|
|
|
}
|
|
|
|
}
|