'Generate a unique name for the index'

def create_index_name(self, table_name, column_names, suffix=''):

    if ((len(column_names) == 1) and (not suffix)):
        try:
            _hash = self._digest([column_names[0]])
        except TypeError:
            _hash = self._digest(column_names[0])
        return self.shorten_name(('%s_%s' % (table_name, _hash)))
    table_name = table_name.replace('"', '').replace('.', '_')
    index_unique_name = ('_%x' % abs(hash((table_name, ','.join(column_names)))))
    index_name = ('%s_%s%s%s' % (table_name, column_names[0], index_unique_name, suffix)).replace('"', '').replace('.', '_')
    if (len(index_name) > self.max_index_name_length):
        part = ('_%s%s%s' % (column_names[0], index_unique_name, suffix))
        index_name = ('%s%s' % (table_name[:(self.max_index_name_length - len(part))], part))
    return index_name
