<?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::create('match_rounds', function (Blueprint $table) {
            $table->id();
            $table->foreignId('video_id')->constrained()->onDelete('cascade');
            $table->integer('round_number');
            $table->string('name')->default('ROUND');
            $table->timestamps();

            $table->unique(['video_id', 'round_number']);
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('match_rounds');
    }
};
