You are here

function boost_update_6100 in Boost 6

Update 6100 - Install Boost Database.

File

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

Code

function boost_update_6100() {

  // Create tables.
  $schema['boost_cache'] = array(
    'description' => t('List of the cached page'),
    'fields' => array(
      'filename' => array(
        'description' => 'Path of the cached file relative to Drupal webroot.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'url' => array(
        'description' => 'URL of cached page',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'expire' => array(
        'description' => t('UNIX timestamp for the expiration date of cached page.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'lifetime' => array(
        'description' => t('Number of seconds this page should be considered fresh. Used to set the expiration column.'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => -1,
      ),
      'push' => array(
        'description' => 'A flag to indicate whether page should be crawled so it is fresh in the cache.',
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => -1,
      ),
      'page_callback' => array(
        'description' => 'The name of the function that renders the page.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'page_arguments' => array(
        'description' => 'The name of the content type.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'indexes' => array(
      'expire' => array(
        'expire',
      ),
      'push' => array(
        'push',
      ),
    ),
    'primary key' => array(
      'filename',
    ),
  );
  $schema['boost_cache_settings'] = array(
    'description' => t('Boost cache settings'),
    'fields' => array(
      'csid' => array(
        'description' => 'Primary Key: Unique cache settings ID.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'page_callback' => array(
        'description' => 'The name of the function that renders the page.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'page_arguments' => array(
        'description' => 'The name of the content type.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'lifetime' => array(
        'description' => t('Number of seconds this page should be considered fresh. Used to set the expiration column.'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => -1,
      ),
      'push' => array(
        'description' => 'A flag to indicate whether page should be crawled so it is fresh in the cache.',
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => -1,
      ),
    ),
    'indexes' => array(
      'page_callback' => array(
        'page_callback',
      ),
      'page_arguments' => array(
        'page_arguments',
      ),
    ),
    'primary key' => array(
      'csid',
    ),
  );
  $ret = array();
  db_create_table($ret, 'boost_cache', $schema['boost_cache']);
  db_create_table($ret, 'boost_cache_settings', $schema['boost_cache_settings']);
  return $ret;
}