首次提交 Laravel 專案
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?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_chats', function (Blueprint $table) {
|
||||
$table->id(); // Laravel 主鍵
|
||||
$table->bigInteger('chat_id')->unique(); // Telegram 群組/頻道 ID(可能為負數)
|
||||
$table->string('type')->nullable(); // group、supergroup、channel、private
|
||||
$table->string('title')->nullable(); // 群組名稱
|
||||
$table->string('username')->nullable(); // @username(如有)
|
||||
$table->text('description')->nullable(); // 群組描述(如有)
|
||||
$table->string('invite_link')->nullable(); // 群組邀請連結(如有)
|
||||
|
||||
// 可選擴充
|
||||
$table->string('photo_small_file_id')->nullable();
|
||||
$table->string('photo_big_file_id')->nullable();
|
||||
|
||||
$table->timestamps(); // 建立/更新時間
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tg_chats');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user