osb/database/migrations/2017_06_18_104531_create_countries_table.php

38 lines
687 B
PHP
Raw Normal View History

2018-06-18 11:18:34 +00:00
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateCountriesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('countries', function(Blueprint $table)
{
$table->increments('id');
$table->string('name', 191);
$table->string('twocode', 2)->nullable();
$table->string('threecode', 3);
$table->integer('currency_id')->unsigned()->nullable()->index('countries_currency_id_foreign');
$table->boolean('active');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('countries');
}
}