<?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('batch_split_events', function (Blueprint $table) {
            $table->foreignId('batch_split_session_id')
                ->nullable()
                ->after('user_id')
                ->constrained('batch_split_sessions')
                ->nullOnDelete();
            $table->string('grading_label')->nullable()->after('destination_batch_id');
        });
    }

    public function down(): void
    {
        Schema::table('batch_split_events', function (Blueprint $table) {
            $table->dropConstrainedForeignId('batch_split_session_id');
            $table->dropColumn('grading_label');
        });
    }
};
