You are here

function feed_import_schema in Feed Import 7

Same name and namespace in other branches
  1. 7.2 feed_import.install \feed_import_schema()

Implements hook_schema().

File

./feed_import.install, line 11
Install/Uninstall code for feed_import

Code

function feed_import_schema() {
  $schema['feed_import_hashes'] = array(
    'description' => 'Feed import hashes',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'description' => 'Primary key',
      ),
      'feed_id' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'description' => 'Feed id',
      ),
      'entity' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'description' => 'Entity name',
      ),
      'entity_id' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'description' => 'Entity id',
      ),
      'hash' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'description' => 'An uniq hash to identify feed item',
      ),
      'expire' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'default' => 0,
        'description' => 'Timestamp when item expires. 0 = never expires',
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  $schema['feed_import_settings'] = array(
    'description' => 'Feed import settings',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'description' => 'Primary key',
      ),
      'enabled' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'description' => 'If feed is enabled or not',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'description' => 'Feed name',
      ),
      'url' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'description' => 'Url to XML file',
      ),
      'time' => array(
        'type' => 'int',
        'default' => 0,
        'description' => 'Seconds to keep items in feed',
      ),
      'entity_info' => array(
        'type' => 'blob',
        'size' => 'big',
        'not null' => TRUE,
        'description' => 'Info about entity wich is populated by import',
      ),
      'xpath' => array(
        'type' => 'blob',
        'size' => 'big',
        'not null' => TRUE,
        'description' => 'XPATH settings',
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  return $schema;
}