<?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('settlement_bills', function (Blueprint $table): void {
            $table->bigInteger('platform_rounding_adjustment')->default(0)->after('adjustment_amount');
        });

        Schema::table('players', function (Blueprint $table): void {
            $table->json('risk_tags')->nullable()->after('status');
        });

        Schema::table('agent_nodes', function (Blueprint $table): void {
            $table->json('risk_tags')->nullable()->after('status');
        });
    }

    public function down(): void
    {
        Schema::table('agent_nodes', function (Blueprint $table): void {
            $table->dropColumn('risk_tags');
        });

        Schema::table('players', function (Blueprint $table): void {
            $table->dropColumn('risk_tags');
        });

        Schema::table('settlement_bills', function (Blueprint $table): void {
            $table->dropColumn('platform_rounding_adjustment');
        });
    }
};
