You are here

function variable_store_schema in Variable 7

Same name and namespace in other branches
  1. 7.2 variable_store/variable_store.install \variable_store_schema()

Implementation of hook_schema().

1 call to variable_store_schema()
variable_store_update_7000 in variable_store/variable_store.install
Reduce realm key field length so it can be used on the primary key

File

variable_store/variable_store.install, line 18
Variable API module install file

Code

function variable_store_schema() {
  $schema['variable_store'] = array(
    'description' => 'Named variable/value pairs created by modules using Variable API database storage. All variables are cached in memory at the start of every Drupal request so developers should not be careless about what is stored here.',
    'fields' => array(
      'realm' => array(
        'description' => 'The realm domain of this variable.',
        'type' => 'varchar',
        'length' => 50,
        'not null' => TRUE,
        'default' => '',
      ),
      'realm_key' => array(
        'description' => 'The realm key of this variable.',
        'type' => 'varchar',
        'length' => 50,
        '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',
      ),
      'serialized' => array(
        'description' => 'A flag to indicate whether content is serialized (1) or not (0).',
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 1,
      ),
    ),
    'primary key' => array(
      'realm',
      'realm_key',
      'name',
    ),
    'indexes' => array(
      'realm_value' => array(
        'realm',
        'realm_key',
      ),
    ),
  );
  return $schema;
}