foothing/laravel-wrappr

View on GitHub
src/database/2015_10_16_000000_make_routes_permissions.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class MakeRoutesPermissions extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up() {

        if (! Schema::hasTable('routes')){
            Schema::create('routes', function(Blueprint $table) {
                $table->increments('id')->unsigned();
                $table->string('verb');
                $table->string('pattern');
                $table->text('permissions');
                $table->string('resourceName')->nullable();
                $table->integer('resourceOffset')->nullable();
                $table->unique(['verb', 'pattern']);
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()    {
        Schema::dropIfExists('routes');
    }
}