You are here

function feedapi_node_schema in FeedAPI 6

Implementation of hook_schema().

File

feedapi_node/feedapi_node.install, line 11
Install file for FeedAPI Node module.

Code

function feedapi_node_schema() {
  $schema['feedapi_node_item'] = array(
    'description' => t('Stores additional information about feed item nodes.'),
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => t("Primary Key: The feed item node's nid."),
      ),
      'url' => array(
        'type' => 'text',
        'not null' => TRUE,
        'description' => t('Link to the feed item.'),
      ),
      'timestamp' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => t('Post date of the feed item, as a Unix timestamp.'),
      ),
      'arrived' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => t('Import date of the feed item, as a Unix timestamp.'),
      ),
      'guid' => array(
        'type' => 'text',
        'not null' => TRUE,
        'description' => t('Unique identifier for the feed item.'),
      ),
    ),
    'primary key' => array(
      'nid',
    ),
    'indexes' => array(
      'url' => array(
        array(
          'url',
          255,
        ),
      ),
      'arrived' => array(
        'arrived',
      ),
      'guid' => array(
        array(
          'guid',
          255,
        ),
      ),
    ),
  );
  $schema['feedapi_node_item_feed'] = array(
    'description' => t('Bridge table; maps feed items to feeds.'),
    'fields' => array(
      'feed_nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => t('The {feedapi}.nid to which the feed item is being assigned.'),
      ),
      'feed_item_nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => t("The feed item's {feedapi_node_item}.nid."),
      ),
    ),
    'primary key' => array(
      'feed_nid',
      'feed_item_nid',
    ),
    'indexes' => array(
      'feed_nid' => array(
        'feed_nid',
      ),
      'feed_item_nid' => array(
        'feed_item_nid',
      ),
    ),
  );
  return $schema;
}