You are here

function redhen_fields_update_7100 in RedHen CRM 7

Add index for email addresses.

File

modules/redhen_fields/redhen_fields.install, line 66
Install, update and uninstall functions for the text module.

Code

function redhen_fields_update_7100(&$sandbox) {
  $fields = field_read_fields(array(
    'type' => 'redhen_email',
  ));
  foreach ($fields as $field_name => $field) {
    if ($field['storage']['type'] == 'field_sql_storage') {
      db_add_index("field_data_{$field_name}", 'redhen_email_address', array(
        "{$field_name}_value",
      ));
      db_add_index("field_revision_{$field_name}", 'redhen_email_address', array(
        "{$field_name}_value",
      ));
    }
  }
}