modified:   pynamodb/connection/base.py

The following ensures the key_schema in indexes is sorted appropriately because AWS's API requires the HASH key to come first. Depending on how the stars align, you may or may not end up with your local or global index key_schema out of order resulting in the following error when creating your table:

<code>pynamodb.exceptions.TableError: Failed to create table: {"__type":"com.amazon.coral.validate#ValidationException","message":"Invalid KeySchema: The first KeySchemaElement is not a HASH key type"</code>