<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

return new class extends Migration
{
    public function up(): void
    {
        DB::statement("DROP INDEX IF EXISTS participants_branch_membership_id_unique");
    }

    public function down(): void
    {
        DB::statement("CREATE UNIQUE INDEX participants_branch_membership_id_unique ON participants (branch_id, membership_id) WHERE membership_id IS NOT NULL AND deleted_at IS NULL");
    }
};
