You are here

function views_make_cache_table in Views (for Drupal 7) 5

This should go in every update to ensure that it's there from a 4.7 -> 5.x update.

3 calls to views_make_cache_table()
views_update_12 in ./views.install
views_update_13 in ./views.install
views_update_14 in ./views.install

File

./views.install, line 487

Code

function views_make_cache_table(&$ret) {
  if (!db_table_exists('cache_views')) {
    switch ($GLOBALS['db_type']) {
      case 'mysql':
      case 'mysqli':
        $ret[] = update_sql("CREATE TABLE {cache_views} (\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_views} (\n            cid varchar(255),\n            data bytea,\n            expire integer,\n            created integer,\n            headers text,\n            PRIMARY KEY (cid)\n          )");
        $ret[] = update_sql("CREATE INDEX {cache_views}_expire_idx ON {cache_views} (expire)");
        break;
    }
  }
}