call the connection.creation.sql_indexes_for_model with model and no_style() as arguments, substitute the result for index_squl.
index_sql = connection . creation . sql_indexes_for_model ( model , no_style ( ) )