Add better error messages and documentation for constraints and indexes