ExpinBot/.svn/pristine/e6/e605b3c25dcaab7e5526c17c266...

42 lines
1.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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('tg_groups', function (Blueprint $table) {
$table->id(); // Laravel 主鍵
$table->bigInteger('chat_id')->unique(); // Telegram 群組/頻道 ID可能為負數
$table->string('type')->nullable()->comment('群类型'); // group、supergroup、channel、private
$table->string('title')->nullable()->comment('群名稱');
$table->string('creator')->nullable()->comment('群主ID');
$table->longText('description')->nullable()->comment('群組描述'); // 群組描述(如有)
$table->string('invite_link')->nullable()->comment('群組邀請連結'); // 群組邀請連結(如有)
// 可選擴充
$table->string('photo_small_file_id')->nullable()->comment('群头像160x160');
$table->string('photo_big_file_id')->nullable()->comment('群头像640x640');
$table->dateTime('created_at')->useCurrent()->nullable();
$table->dateTime('updated_at')->nullable()->useCurrentOnUpdate();
$table->comment('飞机群');
// 设置字符集与排序规则
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_0900_ai_ci';
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('tg_group');
}
};