Shortens index names longer than 50 characters

This PR shortens all index names longer than 50 characters.  The long names have been causing problems with database migrations because rails creates temporary table names whose associated index names exceed the 64 character limit in some cases.