2025_06_24_155101_create_ticket_chats_table.php
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?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');
}
}