You are here

function boost_update_6120 in Boost 6

Update 6120 - Add URL hash & timestamp to boost_cache_relationships

File

./boost.install, line 1364
Handles Boost module installation and upgrade tasks.

Code

function boost_update_6120() {
  $GLOBALS['_boost_max_execution_time'] = ini_get('max_execution_time');
  ini_set('max_execution_time', 10800);

  //3 Hours
  _boost_install_set_time_limit(0);
  $ret = array();

  // Issue #1780860: Must truncate the table because it tends to be huge
  $ret[] = update_sql('TRUNCATE {boost_cache_relationships}');

  // Add in hash_url & timestamp columns to boost_cache
  db_add_field($ret, 'boost_cache_relationships', 'hash_url', array(
    'description' => 'MD5 hash of url',
    'type' => 'varchar',
    'length' => 32,
    'not null' => TRUE,
    'default' => '',
  ));
  db_add_field($ret, 'boost_cache_relationships', 'timestamp', array(
    'description' => 'The Unix timestamp of late update to this field.',
    'type' => 'int',
    'not null' => TRUE,
    'default' => 0,
  ));
  _boost_install_set_time_limit(0);
  ini_set('max_execution_time', $GLOBALS['_boost_max_execution_time']);
  return $ret;
}