You are here

function context_schema in Context 6

Same name and namespace in other branches
  1. 6.3 context.install \context_schema()
  2. 6.2 context.install \context_schema()
  3. 7.3 context.install \context_schema()

Implementation of hook_schema().

File

./context.install, line 20

Code

function context_schema() {
  $schema['context'] = array(
    'description' => t('Storage for normal (user-defined) contexts.'),
    'fields' => array(
      'cid' => array(
        'description' => t('The primary identifier for a context.'),
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'namespace' => array(
        'description' => t('The namespace for a context.'),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'attribute' => array(
        'description' => t('The attribute for a context.'),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'value' => array(
        'description' => t('The value for a context.'),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'data' => array(
        'description' => t('Serialized storage of all associated context items.'),
        'type' => 'text',
        'size' => 'big',
      ),
    ),
    'unique keys' => array(
      'key1' => array(
        'namespace',
        'attribute',
        'value',
      ),
    ),
    'primary key' => array(
      'cid',
    ),
  );
  return $schema;
}