<?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('tribunals', function (Blueprint $table) {
            $table->json('extra_sides')->nullable()->after('side_b');
        });

        // Oy sütununu genişlet (a-z yeterliydi zaten, varchar(1) → varchar(2) yine de)
        Schema::table('tribunal_votes', function (Blueprint $table) {
            $table->string('side', 2)->change();
        });

        Schema::table('tribunal_arguments', function (Blueprint $table) {
            $table->string('side', 2)->change();
        });
    }

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