<?php

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

class AddSomeColumnIntoTopicsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('topics', function (Blueprint $table) {
            $table->text('seo_keywords')->nullable()->after('total_comment');
            $table->text('seo_description')->nullable()->after('total_comment');
            $table->string('seo_title')->nullable()->after('total_comment');
            $table->string('seo_robots')->nullable()->after('total_comment');
            $table->integer('number_of_views')->default(0)->after('total_comment');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('topics', function (Blueprint $table) {
            $table->dropColumn('seo_keywords');
            $table->dropColumn('seo_description');
            $table->dropColumn('seo_title');
            $table->dropColumn('seo_robots');
            $table->dropColumn('number_of_views');
        });
    }
}
