Fix custom unique constraint detection

I had errors because `$constraint['name']` does not exist.