You are here

function httpbl_schema in http:BL 6

Same name and namespace in other branches
  1. 6.2 httpbl.install \httpbl_schema()
  2. 7 httpbl.install \httpbl_schema()

Implementation of hook_schema().

File

./httpbl.install, line 6

Code

function httpbl_schema() {
  $schema['httpbl'] = array(
    'description' => t('Stores http:BL database cache.'),
    'fields' => array(
      'hostname' => array(
        'type' => 'varchar',
        'length' => '128',
        'not null' => TRUE,
        'description' => t('Primary key: Hostname (IP address)'),
      ),
      'status' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        'description' => t('Cache status (HTTPBL_LIST_* constants)'),
      ),
      'expire' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => '11',
        'description' => t('A Unix timestamp indicating when the cache entry should expire.'),
      ),
    ),
    'primary key' => array(
      'hostname',
    ),
    'indexes' => array(
      'expire' => array(
        'expire',
      ),
    ),
  );
  return $schema;
}