<?php

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

/**
 * Migration auto-generated by Sequel Pro Laravel Export
 * @see https://github.com/cviebrock/sequel-pro-laravel-export
 */
class CreateS1CommentInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('s1_comment_info', function (Blueprint $table) {
            $table->increments('id');
//            $table->string('appid')->comment('app_id')->default(0);
            $table->unsignedInteger('wx_user_id')->comment('评论发布者');
            $table->string('wx_user_avatar')->comment('评论者头像')->nullable();
            $table->string('wx_user_nickname')->comment('评论者昵称')->nullable();
            $table->unsignedInteger('s1_goods_id')->comment('对应的商品');
            $table->unsignedInteger('comment_info_id')->comment('评论回复的评论')->default(0);
            $table->text('comment')->comment('评论的内容');
            $table->unsignedTinyInteger('status')->default(1);
            $table->nullableTimestamps();

            $table->index('wx_user_id', 's1_comment_info_wx_user_id_foreign');
            $table->index('s1_goods_id', 's1_comment_info_s1_goods_id_foreign');

        });
    }

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