You are here

function context_schema in Context 7.3

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

Implementation of hook_schema().

File

./context.install, line 24

Code

function context_schema() {
  $schema = array();
  $schema['context'] = array(
    'description' => 'Storage for normal (user-defined) contexts.',
    'export' => array(
      'key' => 'name',
      'identifier' => 'context',
      'default hook' => 'context_default_contexts',
      // Function hook name.
      'status' => 'context_status',
      'api' => array(
        'owner' => 'context',
        'api' => 'context',
        // Base name for api include files.
        'minimum_version' => 3,
        'current_version' => 3,
      ),
      'export callback' => 'context_export',
    ),
    'fields' => array(
      'name' => array(
        'description' => 'The primary identifier for a context.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'description' => array(
        'description' => 'Description for this context.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'tag' => array(
        'description' => 'Tag for this context.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'conditions' => array(
        'description' => 'Serialized storage of all context condition settings.',
        'type' => 'text',
        'serialize' => TRUE,
      ),
      'reactions' => array(
        'description' => 'Serialized storage of all context reaction settings.',
        'type' => 'text',
        'serialize' => TRUE,
      ),
      'condition_mode' => array(
        'description' => 'Condition mode for this context.',
        'type' => 'int',
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'name',
    ),
  );
  return $schema;
}