GrafiteInc/CMS

View on GitHub
src/Migrations/2016_03_20_185046_add_templates_to_blogs.php

Summary

Maintainability
A
1 hr
Test Coverage
<?php

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

class AddTemplatesToBlogs extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::table(config('cms.db-prefix', '').'blogs', function (Blueprint $table) {
            $table->string('template')->default('show');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::table(config('cms.db-prefix', '').'blogs', function ($table) {
            $table->dropColumn('template');
        });
    }
}