You are here

function boost_update_6128 in Boost 6

Update 6128 increase page_id from 64 to 255.

File

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

Code

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

  // Issue #1780860: Must truncate the table because it tends to be huge
  $ret[] = update_sql('TRUNCATE {boost_cache_relationships}');
  db_drop_index($ret, 'boost_cache', 'page_id');
  db_change_field($ret, 'boost_cache', 'page_id', 'page_id', array(
    'description' => 'The ID of the page.',
    'type' => 'varchar',
    'length' => 255,
    'not null' => TRUE,
    'default' => '',
  ));
  db_add_index($ret, 'boost_cache', 'page_id', array(
    'page_id',
  ));
  db_drop_index($ret, 'boost_cache_settings', 'page_id');
  db_change_field($ret, 'boost_cache_settings', 'page_id', 'page_id', array(
    'description' => 'The ID of the page.',
    'type' => 'varchar',
    'length' => 255,
    'not null' => TRUE,
    'default' => '',
  ));
  db_add_index($ret, 'boost_cache_settings', 'page_id', array(
    'page_id',
  ));
  db_drop_index($ret, 'boost_cache_relationships', 'page_id');
  db_change_field($ret, 'boost_cache_relationships', 'page_id', 'page_id', array(
    'description' => 'The ID of the parent page.',
    'type' => 'varchar',
    'length' => 255,
    'not null' => TRUE,
    'default' => '',
  ));
  db_add_index($ret, 'boost_cache_relationships', 'page_id', array(
    'page_id',
  ));
  db_drop_index($ret, 'boost_cache_relationships', 'child_page_id');
  db_change_field($ret, 'boost_cache_relationships', 'child_page_id', 'child_page_id', array(
    'description' => 'The ID of the child page.',
    'type' => 'varchar',
    'length' => 255,
    'not null' => TRUE,
    'default' => '',
  ));
  db_add_index($ret, 'boost_cache_relationships', 'child_page_id', array(
    'child_page_id',
  ));
  return $ret;
}