<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

return new class extends Migration
{
    public function up(): void
    {
        Schema::table('ticket_orders', function (Blueprint $table): void {
            $table->unique(
                ['player_id', 'draw_id', 'client_trace_id'],
                'uniq_ticket_orders_player_draw_trace',
            );
        });
    }

    public function down(): void
    {
        Schema::table('ticket_orders', function (Blueprint $table): void {
            $table->dropUnique('uniq_ticket_orders_player_draw_trace');
        });
    }
};
