<?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::table('baccarat_rounds', function (Blueprint $table) {
            $table->unsignedInteger('bet_count_big')->default(0)->after('bet_count')->comment('押大人数');
            $table->unsignedInteger('bet_count_small')->default(0)->after('bet_count_big')->comment('押小人数');
            $table->unsignedInteger('bet_count_triple')->default(0)->after('bet_count_small')->comment('押豹子人数');
        });
    }

    /**
     * 回滚迁移。
     */
    public function down(): void
    {
        Schema::table('baccarat_rounds', function (Blueprint $table) {
            $table->dropColumn(['bet_count_big', 'bet_count_small', 'bet_count_triple']);
        });
    }
};
