首次提交 Laravel 專案
This commit is contained in:
@@ -0,0 +1 @@
|
||||
a:2:{s:6:"_token";s:40:"jQHg7ffp3mVtOVXeskSPHA6gXrMeoSeqn1E6rKw6";s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?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_group_users', function (Blueprint $table) {
|
||||
$table->increments('id'); // 主键 + AUTO_INCREMENT
|
||||
$table->string('chat_id', 50)->comment('隶属群ID');
|
||||
$table->string('user_id', 15)->comment('tg的ID');
|
||||
$table->string('first_name')->nullable();
|
||||
$table->string('last_name')->nullable();;
|
||||
$table->string('username')->nullable()->comment('tg的username');
|
||||
$table->string('status')->comment('用户在群的角色'); // creator, administrator, member, left, kicked
|
||||
$table->boolean('is_bot')->default(false)->comment('0:真人 1:机器人');
|
||||
$table->string('language_code')->nullable();
|
||||
$table->integer('operator')->default(0)->comment('操作员 0不是1是');
|
||||
$table->integer('competence')->default(0)->comment('0普通权限,1管理员');
|
||||
$table->string('inviter')->nullable()->comment('邀请人');
|
||||
$table->json('raw_data')->nullable();
|
||||
$table->unique(['chat_id', 'user_id']); // 防止重复记录
|
||||
$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('group_users');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user