migrations/2016_10_27_115700_create_shorteners_table.php
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateShortenersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('shorteners', function (Blueprint $table) {
$table->increments('id');
$table->char('hash', 128)->unique();
$table->string('url', 4096);
$table->string('short', 191)->nullable();
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('shorteners');
}
}