Revision db2d93dd
Added by Benjamin Luce over 9 years ago
drupal7/modules/field/modules/field_sql_storage/field_sql_storage.module | ||
---|---|---|
223 | 223 |
foreach ($field['indexes'] as $index_name => $columns) { |
224 | 224 |
$real_name = _field_sql_storage_indexname($field['field_name'], $index_name); |
225 | 225 |
foreach ($columns as $column_name) { |
226 |
$current['indexes'][$real_name][] = _field_sql_storage_columnname($field['field_name'], $column_name); |
|
226 |
// Indexes can be specified as either a column name or an array with |
|
227 |
// column name and length. Allow for either case. |
|
228 |
if (is_array($column_name)) { |
|
229 |
$current['indexes'][$real_name][] = array( |
|
230 |
_field_sql_storage_columnname($field['field_name'], $column_name[0]), |
|
231 |
$column_name[1], |
|
232 |
); |
|
233 |
} |
|
234 |
else { |
|
235 |
$current['indexes'][$real_name][] = _field_sql_storage_columnname($field['field_name'], $column_name); |
|
236 |
} |
|
227 | 237 |
} |
228 | 238 |
} |
229 | 239 |
|
... | ... | |
332 | 342 |
$real_name = _field_sql_storage_indexname($field['field_name'], $name); |
333 | 343 |
$real_columns = array(); |
334 | 344 |
foreach ($columns as $column_name) { |
335 |
$real_columns[] = _field_sql_storage_columnname($field['field_name'], $column_name); |
|
345 |
// Indexes can be specified as either a column name or an array with |
|
346 |
// column name and length. Allow for either case. |
|
347 |
if (is_array($column_name)) { |
|
348 |
$real_columns[] = array( |
|
349 |
_field_sql_storage_columnname($field['field_name'], $column_name[0]), |
|
350 |
$column_name[1], |
|
351 |
); |
|
352 |
} |
|
353 |
else { |
|
354 |
$real_columns[] = _field_sql_storage_columnname($field['field_name'], $column_name); |
|
355 |
} |
|
336 | 356 |
} |
337 | 357 |
db_add_index($table, $real_name, $real_columns); |
338 | 358 |
db_add_index($revision_table, $real_name, $real_columns); |
Also available in: Unified diff
Update to 7.37