<?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('branch_user', function (Blueprint $table): void {
            $table->index(['user_id', 'is_primary'], 'branch_user_user_primary_index');
        });
    }

    public function down(): void
    {
        Schema::table('branch_user', function (Blueprint $table): void {
            $table->dropIndex('branch_user_user_primary_index');
        });
    }
};
