You are here

function apachesolr_update_5005 in Apache Solr Search 5.2

Add ApacheSolr's own cache table.

See also

http://drupal.org/node/630798

File

./apachesolr.install, line 271
Install and related hooks for apachesolr_search.

Code

function apachesolr_update_5005() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("CREATE TABLE {cache_apachesolr} (\n        cid varchar(255) NOT NULL default '',\n        data longblob,\n        expire int NOT NULL default '0',\n        created int NOT NULL default '0',\n        headers text,\n        PRIMARY KEY (cid),\n        INDEX expire (expire)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      $ret[] = update_sql("CREATE TABLE {cache_apachesolr} (\n        cid varchar(255) NOT NULL default '',\n        data bytea,\n        expire numeric(11) NOT NULL default 0,\n        created numeric(11) NOT NULL default 0,\n        headers text,\n        PRIMARY KEY (cid)\n      )");
      $ret[] = update_sql("CREATE INDEX {cache_apachesolr}_expire_idx ON {cache_apachesolr} (expire)");
      break;
  }
  return $ret;
}