2025_07_11_152630_create_ticket_dings_table.php 1.2 KB
<?php

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

class CreateTicketDingsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('gl_ticket_dings', function (Blueprint $table) {
            $table->id();
            $table->json('userIds')->comment('接收人ID列表');
            $table->string('msgKey')->default('sampleMarkdown')->comment('消息模板标识');
            $table->json('msgParam')->comment('消息内容参数,JSON格式');
            $table->smallInteger('status')->default(0)->index()->comment('发送状态:0-未发送,1-已发送,2-发送失败');
            $table->string('errorMsg')->nullable()->comment('错误信息,发送失败时记录');
            $table->string('table_name', 50)->nullable()->comment('关联表名称');
            $table->string('table_id', 50)->nullable()->comment('关联表ID');
            $table->timestamps();
        });
    }

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