<?php

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

class CreatePmsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('pms', function (Blueprint $table) {
            $table->increments('id');
            $table->tinyInteger('msgtype')->comment('消息类型(1:站内信 2:普通消息)');
            $table->integer('msgfromuid')->index()->comment('消息来源uid');
            $table->string('msgfrom')->comment('消息来源');
            $table->string('msgtoname')->comment('对方用户名');
            $table->integer('msgtouid')->index()->comment('对方会员uid');
            $table->string('message')->comment('消息内容');
            $table->tinyInteger('new')->default('1')->comment('查看状态 1:未查看,2已查看))')->nullable();
            $table->string('reply')->comment('回复内容')->nullable();
            $table->integer('replytime')->comment('回复时间')->nullable();
            $table->integer('replyuid')->comment('回复uid')->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

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