You are here

function customfilter_update_6111 in Custom filter 7.2

Same name and namespace in other branches
  1. 6 customfilter.install \customfilter_update_6111()
  2. 7 customfilter.install \customfilter_update_6111()

Implements hook_update_N().

1 string reference to 'customfilter_update_6111'
customfilter_update_6119 in ./customfilter.install
Implements hook_update_N().

File

./customfilter.install, line 402
Installation file for Custom filter.

Code

function customfilter_update_6111() {
  $ret = array();
  if (!variable_get('customfilter_update_6111', FALSE)) {
    db_drop_index('customfilter_rules', 'weight');
    db_add_index('customfilter_rules', 'customfilter_rule_fid', array(
      'fid',
    ));
    db_add_index('customfilter_rules', 'customfilter_rule_weight', array(
      'weight',
    ));
    if (db_table_exists('customfilter_filters')) {
      if (db_table_exists('customfilter_filter')) {
        db_drop_table('customfilter_filter');
      }
      db_rename_table('customfilter_filters', 'customfilter_filter');
    }
    if (db_table_exists('customfilter_rules')) {
      if (db_table_exists('customfilter_rule')) {
        db_drop_table('customfilter_rule');
      }
      db_rename_table('customfilter_rules', 'customfilter_rule');
    }
    variable_set('customfilter_update_6111', TRUE);
  }

  // hook_update_N() no longer returns a $ret array. Instead, return
  // nothing or a translated string indicating the update ran successfully.
  // See http://drupal.org/node/224333#update_sql.
  return t('TODO Add a descriptive string here to show in the UI.');
}