2023_03_02_214554_create_feedback_table.php 1.06 KB
<?php

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

class CreateFeedbackTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('feedback', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger("from_user_id")->comment("发起用户");
            $table->unsignedInteger("to_user_id")->default(1)->comment("接收用户");
            $table->unsignedTinyInteger("type")->comment("消息类型");
            $table->text("content")->comment("内容");
            $table->unsignedTinyInteger("is_from_user")->comment("发起者");
            $table->unsignedTinyInteger("state")->comment("0=未读1=已读");
            $table->timestamp('send_time', 0)->nullable()->comment("发送时间");
        });
    }

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