支持所有游戏按房间范围配置和运行

This commit is contained in:
pllx
2026-04-29 14:37:28 +08:00
parent 3672140987
commit 1607f57e3c
37 changed files with 1033 additions and 255 deletions
@@ -0,0 +1,62 @@
<?php
/**
* 文件功能:为公共回合型游戏补充 room_id 字段
*
* 让百家乐、赛马、彩票和神秘箱子可以按房间独立开局、查询与广播。
*/
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::table('baccarat_rounds', function (Blueprint $table) {
$table->unsignedBigInteger('room_id')->default(1)->after('id')->index();
});
Schema::table('horse_races', function (Blueprint $table) {
$table->unsignedBigInteger('room_id')->default(1)->after('id')->index();
});
Schema::table('lottery_issues', function (Blueprint $table) {
$table->unsignedBigInteger('room_id')->default(1)->after('id')->index();
});
Schema::table('mystery_boxes', function (Blueprint $table) {
$table->unsignedBigInteger('room_id')->default(1)->after('id')->index();
});
}
/**
* 回滚迁移。
*/
public function down(): void
{
Schema::table('baccarat_rounds', function (Blueprint $table) {
$table->dropIndex(['room_id']);
$table->dropColumn('room_id');
});
Schema::table('horse_races', function (Blueprint $table) {
$table->dropIndex(['room_id']);
$table->dropColumn('room_id');
});
Schema::table('lottery_issues', function (Blueprint $table) {
$table->dropIndex(['room_id']);
$table->dropColumn('room_id');
});
Schema::table('mystery_boxes', function (Blueprint $table) {
$table->dropIndex(['room_id']);
$table->dropColumn('room_id');
});
}
};