fix(chat): 添加 game_configs 表缺失的 type 字段的迁移文件

This commit is contained in:
2026-03-12 08:36:55 +08:00
parent 1c42f05e20
commit b7f2dae847

View File

@@ -0,0 +1,31 @@
<?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::table('game_configs', function (Blueprint $table) {
$table->string('type', 20)->default('general')->after('id')->comment('配置分类gomoku/general等');
// 为了保证加速查询
$table->index(['type', 'key']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('game_configs', function (Blueprint $table) {
$table->dropIndex(['type', 'key']);
$table->dropColumn('type');
});
}
};