for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateRoutesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
Schema::create('routes', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('url', 500)->unique()->index();
$table->nullableMorphs('routable');
$table->unsignedInteger('canonical_id')->nullable()
->references('id')->on('routes');
$table->unsignedInteger('redirect_id')->nullable()
->references('id')->on('routes')->onDelete('cascade');
$table->softDeletes();
$table->timestamps();
});
}
* Reverse the migrations.
public function down()
Schema::dropIfExists('routes');