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-10 11:19:17 +08:00
|
|
|
$table->integer('aircraft_class_id')->unsigned();
|
2017-06-09 09:37:51 +08:00
|
|
|
$table->string('icao');
|
|
|
|
$table->string('name');
|
|
|
|
$table->string('full_name')->nullable();
|
|
|
|
$table->string('registration')->nullable();
|
2017-06-10 11:19:17 +08:00
|
|
|
$table->string('tail_number')->nullable();
|
|
|
|
$table->string('cargo_capacity')->nullable();
|
|
|
|
$table->string('fuel_capacity')->nullable();
|
|
|
|
$table->boolean('active')->default(true);
|
2017-06-09 09:37:51 +08:00
|
|
|
$table->timestamps();
|
|
|
|
$table->softDeletes();
|
2017-06-10 11:19:17 +08:00
|
|
|
|
|
|
|
$table->index('icao');
|
|
|
|
$table->unique('registration');
|
|
|
|
});
|
|
|
|
|
|
|
|
Schema::create('aircraft_classes', function (Blueprint $table) {
|
|
|
|
$table->increments('id');
|
|
|
|
$table->string('code');
|
|
|
|
$table->string('name');
|
|
|
|
$table->string('notes')->nullable();
|
|
|
|
$table->timestamps();
|
|
|
|
$table->softDeletes();
|
|
|
|
|
|
|
|
$table->index('code');
|
2017-06-09 09:37:51 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::drop('aircraft');
|
2017-06-10 11:19:17 +08:00
|
|
|
Schema::drop('aircraft_classes');
|
2017-06-09 09:37:51 +08:00
|
|
|
}
|
|
|
|
}
|