File: D:/HostingSpaces/SBogers10/komma.pro/database/migrations/2016_08_04_000009_create_routes_table.php
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateRoutesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('routes', function(Blueprint $table)
{
$table->increments('id');
$table->string('route');
$table->string('alias');
$table->integer('routeable_id')->unsigned();
$table->string('routeable_type');
$table->integer('site_id')->unsigned();
$table->integer('language_id')->unsigned();
$table->timestamps();
$table->index(['routeable_id','routeable_type']);
$table->foreign('language_id')->references('id')->on('languages');
$table->foreign('site_id')->references('id')->on('sites');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('routes');
}
}