You are here

function vars_schema in Variable API 6.2

Same name and namespace in other branches
  1. 6 vars.install \vars_schema()
  2. 7.2 vars.install \vars_schema()
  3. 7 vars.install \vars_schema()

Implements hook_schema().

File

./vars.install, line 11
Install, update and uninstall functions for the Variable API module.

Code

function vars_schema() {
  $schema = array();
  $schema['variable_default'] = array(
    'description' => 'The default values for the variables as set by the modules.',
    'fields' => array(
      'vdid' => array(
        'description' => 'The primary key.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'module' => array(
        'description' => 'The module owning the variable.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'name' => array(
        'description' => 'The name of the variable.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ),
      'value' => array(
        'description' => 'The value of the variable.',
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
      ),
      'flags' => array(
        'description' => 'Flags associated with the variable.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
      ),
    ),
    'indexes' => array(
      'module' => array(
        array(
          'module',
          32,
        ),
      ),
      'name' => array(
        array(
          'name',
          32,
        ),
      ),
      'flags' => array(
        'flags',
      ),
    ),
    'unique key' => array(
      'module_name' => array(
        'module',
        'name',
      ),
    ),
    'primary key' => array(
      'vdid',
    ),
  );
  $schema['cache_vars'] = drupal_get_schema_unprocessed('system', 'cache');
  $schema['cache_vars']['description'] = 'Cache table for the Variable API module.';
  return $schema;
}