You are here

function boost_schema in Boost 6

Implementation of hook_schema().

File

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

Code

function boost_schema() {
  $schema['boost_cache'] = array(
    'description' => t('List of the cached page'),
    'fields' => array(
      'hash' => array(
        'description' => 'MD5 hash of filename',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'filename' => array(
        'description' => 'Path of the cached file relative to Drupal webroot.',
        'type' => 'text',
        'size' => 'normal',
        'not null' => TRUE,
      ),
      'base_dir' => array(
        'description' => 'Path of the cache root dir relative to Drupal webroot.',
        'type' => 'varchar',
        'length' => 128,
        '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_type' => array(
        'description' => 'The name of the content type.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'page_id' => array(
        'description' => 'The ID of the page.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'extension' => array(
        'description' => 'File Extension/Mime content type of this page.',
        'type' => 'varchar',
        'length' => 8,
        'not null' => TRUE,
        'default' => '',
      ),
      'timer' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Time in milliseconds that the page took to be generated.',
      ),
      'timer_average' => array(
        'type' => 'float',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Average time in milliseconds that the page took to be generated.',
      ),
      'hash_url' => array(
        'description' => 'MD5 hash of url',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'url' => array(
        'description' => 'URL of cached page',
        'type' => 'text',
        'size' => 'normal',
        'not null' => TRUE,
      ),
    ),
    'indexes' => array(
      'expire' => array(
        'expire',
      ),
      'push' => array(
        'push',
      ),
      'base_dir' => array(
        'base_dir',
      ),
      'page_id' => array(
        'page_id',
      ),
      'timer' => array(
        'timer',
      ),
      'timer_average' => array(
        'timer_average',
      ),
      'page_callback' => array(
        'page_callback',
      ),
      'page_type' => array(
        'page_type',
      ),
      'extension' => array(
        'extension',
      ),
    ),
    'primary key' => array(
      'hash',
    ),
  );
  $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,
      ),
      'base_dir' => array(
        'description' => 'Path of the cache root dir relative to Drupal webroot.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ),
      'page_callback' => array(
        'description' => 'The name of the function that renders the page.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'page_type' => array(
        'description' => 'The name of the content type.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '0',
      ),
      'page_id' => array(
        'description' => 'The ID of the page.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'extension' => array(
        'description' => 'File Extension/Mime content type of this page.',
        'type' => 'varchar',
        'length' => 8,
        '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_type' => array(
        'page_type',
      ),
      'base_dir' => array(
        'base_dir',
      ),
      'page_id' => array(
        'page_id',
      ),
      'extension' => array(
        'extension',
      ),
    ),
    'primary key' => array(
      'csid',
    ),
  );
  $schema['boost_crawler'] = array(
    'description' => t('Boost crawler - temp table'),
    'fields' => array(
      'id' => array(
        'description' => 'Primary Key: Unique ID.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'hash' => array(
        'description' => 'MD5 hash of url',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'url' => array(
        'description' => 'URL of page',
        'type' => 'text',
        'size' => 'normal',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'indexes' => array(
      'hash' => array(
        'hash',
      ),
    ),
  );
  $schema['boost_cache_relationships'] = array(
    'description' => t('Boost parent child relationships'),
    'fields' => array(
      'hash' => array(
        'description' => 'MD5 hash of below items in the database',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'base_dir' => array(
        'description' => 'Path of the cache root dir relative to Drupal webroot.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ),
      'page_callback' => array(
        'description' => 'The name of the parent function that renders the page.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'page_type' => array(
        'description' => 'The name of the parent content type.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '0',
      ),
      'page_id' => array(
        'description' => 'The ID of the parent page.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'child_page_callback' => array(
        'description' => 'The name of the child function that renders the page.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'child_page_type' => array(
        'description' => 'The name of the child content type.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '0',
      ),
      'child_page_id' => array(
        'description' => 'The ID of the child page.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'hash_url' => array(
        'description' => 'MD5 hash of url',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'timestamp' => array(
        'description' => 'The Unix timestamp of late update to this field.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'base_dir' => array(
        'base_dir',
      ),
      'page_callback' => array(
        'page_callback',
      ),
      'page_type' => array(
        'page_type',
      ),
      'page_id' => array(
        'page_id',
      ),
      'child_page_callback' => array(
        'child_page_callback',
      ),
      'child_page_type' => array(
        'child_page_type',
      ),
      'child_page_id' => array(
        'child_page_id',
      ),
      'hash_url' => array(
        'hash_url',
      ),
      'timestamp' => array(
        'timestamp',
      ),
    ),
    'primary key' => array(
      'hash',
    ),
  );
  return $schema;
}