<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
class CreateDocterMessagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('docter_messages', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('user_id')->comment("用户ID");
            $table->integer('docter_id')->comment("医生ID");
            $table->tinyInteger('status')->comment("状态(1.未读 2.已读)");
            $table->tinyInteger('type')->comment("类型(1.图文订单 2.电话订单 3.预约订单 4.评价通知 5.系统通知)");
            $table->integer('relation_id')->comment("关联ID(发出消息操作关联的表的id，比如：医生结束消息时，就该关联意见单ID,因为用户点击消息会进入看意见单)");
            $table->string('content',500)->comment("消息内容");
            $table->timestamps();
        });
        DB::statement("ALTER TABLE `docter_messages` comment '医生消息表'");
    }

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