You are here

function _heartbeat_update_7010 in Heartbeat 7

Helper function to add the new schema for streams.

2 calls to _heartbeat_update_7010()
heartbeat_schema in ./heartbeat.install
Implementation of hook_schema().
heartbeat_update_7010 in ./heartbeat.install
Removing fields from D6 branch, replacing some things by ctools export.

File

./heartbeat.install, line 265
Installation file for the heartbeat module. @author Jochen Stals - Menhir - www.menhir.be

Code

function _heartbeat_update_7010() {
  $schema['heartbeat_streams'] = array(
    'description' => t('Table that contains heartbeat streams.'),
    // CTools export definitions.
    'export' => array(
      'key' => 'class',
      'key name' => 'name',
      'primary key' => 'class',
      'bulk export' => TRUE,
      'identifier' => 'heartbeatstream',
      'object' => 'HeartbeatStreamConfig',
      'default hook' => 'heartbeat_stream_info',
      'load callback' => '_heartbeat_stream_config_load',
      'load all callback' => '_heartbeat_stream_config_load_all',
      'can disable' => TRUE,
      'api' => array(
        'owner' => 'heartbeat',
        'api' => 'heartbeat',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'class' => array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'default' => '',
        'description' => t('Class of the stream to load.'),
      ),
      'real_class' => array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'default' => '',
        'description' => t('Real Class of the stream to load.'),
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'default' => '',
        'description' => t('Name of the stream. Cloned streams will have the same object but same class.'),
      ),
      'module' => array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'default' => '',
        'description' => t('The module that defines the class and where the query builder is located.'),
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'default' => '',
        'description' => t('Human readable name of the stream.'),
      ),
      'path' => array(
        'type' => 'varchar',
        'length' => 250,
        'not null' => TRUE,
        'default' => '',
        'description' => t('Path to the stream object.'),
      ),
      'settings' => array(
        'description' => t('Serialized settings for this stream.'),
        'type' => 'blob',
        'serialize' => TRUE,
        'not null' => FALSE,
      ),
      'variables' => array(
        'description' => t('Variables to parse into the message (used in message).'),
        'type' => 'blob',
        'serialize' => TRUE,
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'class',
    ),
    'indexes' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  return $schema;
}