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-11 07:27:19 +08:00
|
|
|
$table->integer('aircraft_class_id')->unsigned()->nullable();
|
2017-06-09 09:37:51 +08:00
|
|
|
$table->string('icao');
|
|
|
|
$table->string('name');
|
|
|
|
$table->string('registration')->nullable();
|
2017-06-10 11:19:17 +08:00
|
|
|
$table->string('tail_number')->nullable();
|
2017-06-23 09:55:45 +08:00
|
|
|
$table->double('cargo_capacity', 19, 2)->nullable();
|
|
|
|
$table->double('fuel_capacity', 19, 2)->nullable();
|
|
|
|
$table->double('gross_weight', 19, 2)->nullable();
|
|
|
|
$table->tinyInteger('fuel_type')->unsigned()->nullable();
|
2017-06-10 11:19:17 +08:00
|
|
|
$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');
|
|
|
|
}
|
|
|
|
}
|