Fix for #Python-533. Secondary index on set field

This commit is contained in:
Nikolay Fominykh
2016-04-03 18:50:05 +03:00
parent a89fddc19e
commit 9dce60a745

View File

@@ -113,7 +113,8 @@ def _get_index_name_by_column(table, column_name):
"""
for _, index_metadata in six.iteritems(table.indexes):
options = dict(index_metadata.index_options)
if 'target' in options and options['target'] == column_name:
possible_index_values = [column_name, "values(%s)" % column_name]
if 'target' in options and options['target'] in possible_index_values:
return index_metadata.name
return None