2025_06_24_155101_create_ticket_chats_table.php 1.1 KB
<?php

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

class CreateTicketChatsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('gl_ticket_chats', function (Blueprint $table) {
            $table->id();
            $table->longText('content')->comment('消息内容');
            $table->json('files')->nullable()->comment('附件');
            $table->foreignId('ticket_id')->constrained('gl_tickets')->onDelete('cascade')->comment('工单ID');
            $table->integer('manage_id')->default(0)->comment('gl_manage 表ID');
            $table->integer('submit_side')->index()->default(1)->comment('提交方,1: A端, 2: B端');
            $table->string('submit_username')->nullable()->comment('提交人姓名,B端在企微群提交时,留个姓名即可');
            $table->timestamps();
        });
    }

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