You are here

function feedapi_schema in FeedAPI 6

Implementation of hook_schema().

File

./feedapi.install, line 11
Install file for FeedAPI module.

Code

function feedapi_schema() {
  $schema['feedapi'] = array(
    'description' => 'Stores feed-related info for each feed',
    'fields' => array(
      'nid' => array(
        'description' => 'The node identifier where the feed belongs.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'vid' => array(
        'description' => 'The primary identifier for the feed.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'url' => array(
        'description' => 'The URL of the feed',
        'type' => 'text',
        'not null' => TRUE,
      ),
      'feed_type' => array(
        'description' => 'Type of feed',
        'type' => 'varchar',
        'not null' => TRUE,
        'default' => 'XML feed',
        'length' => '50',
      ),
      'processors' => array(
        'description' => 'List of enabled processors',
        'type' => 'varchar',
        'not null' => TRUE,
        'default' => '',
        'length' => '255',
      ),
      'parsers' => array(
        'description' => 'List of enabled parsers',
        'type' => 'varchar',
        'not null' => TRUE,
        'default' => '',
        'length' => '255',
      ),
      'next_refresh_time' => array(
        'description' => 'Timestamp of the earliest possible next refresh time',
        'type' => 'int',
        'unsigned' => FALSE,
        'default' => 0,
        'not null' => TRUE,
      ),
      'hash' => array(
        'description' => 'Hash of the feed content',
        'type' => 'varchar',
        'length' => '32',
      ),
      'link' => array(
        'description' => 'URL of the source site of the feed',
        'type' => 'text',
      ),
      'settings' => array(
        'description' => 'Various settings of the feed',
        'type' => 'text',
        'size' => 'big',
      ),
      'half_done' => array(
        'description' => 'Indicates if not all of the feed items were processed at the last cron run',
        'type' => 'int',
        'size' => 'tiny',
      ),
    ),
    'primary key' => array(
      'vid',
      'nid',
    ),
    'indexes' => array(
      'vid' => array(
        'vid',
      ),
      'next_refresh_time' => array(
        'next_refresh_time',
      ),
    ),
  );
  $schema['feedapi_stat'] = array(
    'description' => 'Statistics values over the time about the feeds',
    'fields' => array(
      'id' => array(
        'description' => 'Unique identifier for statistics data',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'type' => array(
        'description' => 'Type of the data',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'timestamp' => array(
        'description' => 'Timestamp of the data',
        'type' => 'int',
        'not null' => TRUE,
      ),
      'time' => array(
        'description' => 'Time of the data',
        'type' => 'varchar',
        'length' => 20,
        'not null' => TRUE,
      ),
      'value' => array(
        'description' => 'Value of the data',
        'type' => 'int',
      ),
    ),
    'indexes' => array(
      'feedapi_stat_id' => array(
        'id',
      ),
      'feedapi_stat_type' => array(
        'type',
      ),
    ),
    'feedapi_stat_timestamp' => array(
      'timestamp',
    ),
    'feedapi_stat_time' => array(
      'time',
    ),
  );
  return $schema;
}