<?php

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

class CreateCommentInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('comments_info', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('interaction_id')->comment('梦想动态ID');
            $table->integer('user_id')->comment('评论用户id');
            $table->string('user_avatar')->default('')->comment('评论用户头像');
            $table->string('user_nickname')->default('')->comment('评论用户昵称');
            $table->integer('to_user_id')->nullable()->comment('回复用户id');
            $table->string('to_user_avatar')->default('')->comment('回复用户头像');
            $table->string('to_user_nickname')->default('')->comment('回复用户昵称');
            $table->tinyInteger('level')->default(0)->comment('评论星级');
            $table->tinyInteger('is_read')->default(0)->comment('是否阅读');
            $table->text('content')->comment('评论内容');
            $table->timestamps();
            $table->date('reply_time')->nullable()->comment('回复时间');
            $table->softDeletes();
        });
    }

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