You are here

function location_search_update_5300 in Location 5.3

Same name and namespace in other branches
  1. 6.3 contrib/location_search/location_search.install \location_search_update_5300()
  2. 7.5 contrib/location_search/location_search.install \location_search_update_5300()
  3. 7.3 contrib/location_search/location_search.install \location_search_update_5300()
  4. 7.4 contrib/location_search/location_search.install \location_search_update_5300()

Rewritten location_search -- Uses the fulltext engine.

File

contrib/location_search/location_search.install, line 48
Installation routines for location_search_new.

Code

function location_search_update_5300() {
  $ret = array();

  // Create our worklist table.
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("\n      CREATE TABLE {location_search_work} (\n        lid int UNSIGNED NOT NULL DEFAULT '0',\n        PRIMARY KEY (lid)\n      ) /*!40100 DEFAULT CHARACTER SET utf8 */");
      break;
    case 'pgsql':
      $ret[] = update_sql("\n      CREATE TABLE {location_search_work} (\n        lid int NOT NULL DEFAULT '0' CHECK (lid >= 0),\n        PRIMARY KEY (lid)\n      )");
      break;
  }

  // Force reindexing.
  $ret[] = update_sql('INSERT INTO {location_search_work} (SELECT lid FROM {location})');

  // Remove unused variables.
  variable_del('location_suppress_country');
  variable_del('location_search_distance_unit');
  return $ret;
}