phpvms/database/migrations/2017_06_09_010621_create_aircrafts_table.php

36 lines
1.1 KiB
PHP
Raw Normal View History

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');
$table->integer('subfleet_id')->unsigned()->nullable();
$table->string('hex_code')->nullable();
2017-06-09 09:37:51 +08:00
$table->string('icao');
$table->string('name');
$table->string('registration')->nullable();
$table->string('tail_number')->nullable();
$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();
$table->boolean('active')->default(true);
2017-06-09 09:37:51 +08:00
$table->timestamps();
$table->index('icao');
$table->unique('registration');
});
2017-06-09 09:37:51 +08:00
}
public function down()
{
Schema::drop('aircraft');
}
}