database/migrations/2015_01_27_190909_create_db_extras_tables.php
public function up()
    {
        $driver = Schema::getConnection()->getDriverName();
        // Even though we take care of this scenario in the code,
        // SQL Server does not allow potential cascading loops,
        // so set the default no action and clear out created/modified by another user when deleting a user.
        $onDelete = (('sqlsrv' === $driver) ? 'no action' : 'set null');

        $output = new ConsoleOutput();
        $output->writeln("Migration driver used: $driver");

        // Database Table Extras
        if (!Schema::hasTable('db_table_extras')) {
            Schema::create(
                'db_table_extras',
                function (Blueprint $t) use ($onDelete) {
                    $t->increments('id');
                    $t->integer('service_id')->unsigned();
                    $t->foreign('service_id')->references('id')->on('service')->onDelete('cascade');
                    $t->string('table');
                    $t->string('label')->nullable();
                    $t->string('plural')->nullable();
                    $t->string('name_field', 128)->nullable();
                    $t->string('model')->nullable();
                    $t->text('description')->nullable();
                    $t->timestamp('created_date')->nullable();
                    $t->timestamp('last_modified_date')->useCurrent();
                    $t->integer('created_by_id')->unsigned()->nullable();
                    $t->foreign('created_by_id')->references('id')->on('user')->onDelete($onDelete);
                    $t->integer('last_modified_by_id')->unsigned()->nullable();
                    $t->foreign('last_modified_by_id')->references('id')->on('user')->onDelete($onDelete);
                }
            );
        }

        // Database Field Extras
        if (!Schema::hasTable('db_field_extras')) {
            Schema::create(
                'db_field_extras',
                function (Blueprint $t) use ($onDelete) {
                    $t->increments('id');
                    $t->integer('service_id')->unsigned();
                    $t->foreign('service_id')->references('id')->on('service')->onDelete('cascade');
                    $t->string('table');
                    $t->string('field');
                    $t->string('label')->nullable();
                    $t->string('extra_type')->nullable();
                    $t->text('description')->nullable();
                    $t->text('picklist')->nullable();
                    $t->text('validation')->nullable();
                    $t->text('client_info')->nullable();
                    $t->timestamp('created_date')->nullable();
                    $t->timestamp('last_modified_date')->useCurrent();
                    $t->integer('created_by_id')->unsigned()->nullable();
                    $t->foreign('created_by_id')->references('id')->on('user')->onDelete($onDelete);
                    $t->integer('last_modified_by_id')->unsigned()->nullable();
                    $t->foreign('last_modified_by_id')->references('id')->on('user')->onDelete($onDelete);
                }
            );
        }
    }
public function up()
    {
        $driver = Schema::getConnection()->getDriverName();
        // Even though we take care of this scenario in the code,
        // SQL Server does not allow potential cascading loops,
        // so set the default no action and clear out created/modified by another user when deleting a user.
        $onDelete = (('sqlsrv' === $driver) ? 'no action' : 'set null');

        $output = new ConsoleOutput();
        $output->writeln("Migration driver used: $driver");

        // Database Table Extras
        if (!Schema::hasTable('db_table_extras')) {
            Schema::create(
                'db_table_extras',
                function (Blueprint $t) use ($onDelete) {
                    $t->increments('id');
                    $t->integer('service_id')->unsigned();
                    $t->foreign('service_id')->references('id')->on('service')->onDelete('cascade');
                    $t->string('table');
                    $t->string('label')->nullable();
                    $t->string('plural')->nullable();
                    $t->string('name_field', 128)->nullable();
                    $t->string('model')->nullable();
                    $t->text('description')->nullable();
                    $t->timestamp('created_date')->nullable();
                    $t->timestamp('last_modified_date')->useCurrent();
                    $t->integer('created_by_id')->unsigned()->nullable();
                    $t->foreign('created_by_id')->references('id')->on('user')->onDelete($onDelete);
                    $t->integer('last_modified_by_id')->unsigned()->nullable();
                    $t->foreign('last_modified_by_id')->references('id')->on('user')->onDelete($onDelete);
                }
            );
        }

        // Database Field Extras
        if (!Schema::hasTable('db_field_extras')) {
            Schema::create(
                'db_field_extras',
                function (Blueprint $t) use ($onDelete) {
                    $t->increments('id');
                    $t->integer('service_id')->unsigned();
                    $t->foreign('service_id')->references('id')->on('service')->onDelete('cascade');
                    $t->string('table');
                    $t->string('field');
                    $t->string('label')->nullable();
                    $t->string('extra_type')->nullable();
                    $t->text('description')->nullable();
                    $t->text('picklist')->nullable();
                    $t->text('validation')->nullable();
                    $t->text('client_info')->nullable();
                    $t->timestamp('created_date')->nullable();
                    $t->timestamp('last_modified_date')->useCurrent();
                    $t->integer('created_by_id')->unsigned()->nullable();
                    $t->foreign('created_by_id')->references('id')->on('user')->onDelete($onDelete);
                    $t->integer('last_modified_by_id')->unsigned()->nullable();
                    $t->foreign('last_modified_by_id')->references('id')->on('user')->onDelete($onDelete);
                }
            );
        }
    }
Run the migrations.

@return void