<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('tgBot', function (Blueprint $table) {
            $table->increments('id'); // 主键 + AUTO_INCREMENT
            $table->string('bot_id')->nullable()->comment('bot_id');
            $table->string('bot_token')->nullable()->comment('bot_oken');
            $table->string('bot_username')->nullable()->comment('bot名称');
            $table->string('subjection_username')->nullable()->comment('隶属飞机用户');
            $table->string('subjection_mobile')->nullable()->comment('隶属飞机用户手机号');
            $table->longText('webhook')->nullable()->comment('webhook_url');
            $table->longText('memo')->nullable()->comment('备注说明');
            $table->dateTime('created_at')->useCurrent()->nullable();
            $table->dateTime('updated_at')->nullable()->useCurrentOnUpdate();
            $table->charset = 'utf8mb4';
            $table->collation = 'utf8mb4_0900_ai_ci';
            $table->comment('机器人资料');
        });
    }

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