39 lines
784 B
PHP
39 lines
784 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
class CreateAirlinesTable extends Migration
|
|
{
|
|
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('airlines', function (Blueprint $table) {
|
|
$table->increments('id');
|
|
$table->string('code');
|
|
$table->string('name');
|
|
$table->char('country', 2)->nullable();
|
|
$table->boolean('active');
|
|
$table->timestamps();
|
|
|
|
$table->index('code');
|
|
$table->unique('code');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::drop('airlines');
|
|
}
|
|
}
|