<?php

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

class CreateWxArticleInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wx_article_info', function (Blueprint $table) {
            $table->increments('id');
            $table->string('appid')->comment('app_id')->default(0);
            $table->unsignedInteger('wx_category_info_id')->comment('分类id')->default(0);
            $table->string('title',255)->comment('文章标题');
            $table->string('pic')->nullable()->comment('封面图片');
            $table->text('info')->comment('文本内容');
            $table->unsignedInteger('viewed')->default(0)->comment('浏览量统计');
            $table->unsignedInteger('status')->default(1)->comment('是否启用');
            $table->unsignedInteger('sort')->default(0)->comment('排序');
//            $table->foreign('wx_category_info_id')->references('id')->on('wx_article_category')->comment('外键关联分类');
            $table->timestamps();
        });
    }

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