34 lines
1.4 KiB
Plaintext
34 lines
1.4 KiB
Plaintext
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration {
|
|
public function up(): void
|
|
{
|
|
Schema::create('tg_comm', function (Blueprint $table) {
|
|
$table->increments('id'); // PRIMARY KEY + AUTO_INCREMENT
|
|
$table->string('command', 100)->nullable()->comment('指令名称');
|
|
$table->string('Instructions')->nullable()->comment('说明');
|
|
$table->string('action', )->nullable()->comment('对应动作指令');
|
|
$table->text('memo')->nullable()->comment('使用说明');
|
|
$table->integer('dis_play')->default(1)->comment('指令列表 0不显示 1显示');
|
|
$table->integer('manager')->default(0)->comment('管理权限0需要1不需要');
|
|
$table->integer('valid')->default(1)->comment('0停用1启用');
|
|
$table->timestamp('created_at')->useCurrent()->nullable();
|
|
$table->timestamp('updated_at')->nullable()->useCurrentOnUpdate();
|
|
// 可选:你也可以在这里设置表的注释
|
|
$table->comment('机器人指令');
|
|
// 指定表的 charset 与 collation
|
|
$table->charset = 'utf8mb4';
|
|
$table->collation = 'utf8mb4_0900_ai_ci';
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('tg_comm');
|
|
}
|
|
};
|