You are here

function search_autocomplete_update_7310 in Search Autocomplete 7.3

Get ready for Search Autocomplete 7.x-3.1

File

./search_autocomplete.install, line 278
This file is used to install/update/delete the module tables in database

Code

function search_autocomplete_update_7310(&$sandbox) {
  $ret = array();
  $translite_field = array(
    'description' => 'Define if suggestion searches should be translited',
    'type' => 'int',
    'not null' => TRUE,
    'default' => 1,
  );
  db_add_field('search_autocomplete_forms', 'translite', $translite_field);
  $no_results_field = array(
    'description' => 'Maximum number of suggestions',
    'type' => 'varchar',
    'length' => 50,
    'not null' => FALSE,
    'default' => '-- no results --',
  );
  db_add_field('search_autocomplete_forms', 'no_results', $no_results_field);
  drupal_clear_js_cache();
  return t('Update has:<br/>- add a column "translite" in the search autocomplete database.<br/>- add a column "no_results" in the search autocomplete database.<br/> Done with success.');

  // In case of an error, simply throw an exception with an error message.
  throw new DrupalUpdateException('Something went wrong. Please uninstall and install the module again.');
  return $ret;
}