You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.3 KiB
44 lines
1.3 KiB
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration {
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('messages', function (Blueprint $table) {
|
|
$table->comment('消息表');
|
|
$table->id();
|
|
$table->integer('dialogue_id')->nullable()->comment('对话id');
|
|
// 用户id
|
|
$table->integer('user_id')->nullable()->comment('用户id');
|
|
// 接收人id
|
|
$table->integer('to_user_id')->nullable()->comment('接收人id');
|
|
// 需求id
|
|
$table->integer('supply_demand_id')->nullable()->comment('需求id');
|
|
// 消息内容
|
|
$table->text('content')->nullable()->comment('消息内容');
|
|
// 接收方是否已读
|
|
$table->tinyInteger('is_read')->nullable()->default(0)->comment('接收方是否已读0否1是');
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('massages');
|
|
}
|
|
};
|