支持所有游戏按房间范围配置和运行
This commit is contained in:
+62
@@ -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');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user