You are here

feeds_comment_processor.install in Feeds Comment Processor 6

Same filename and directory in other branches
  1. 7 feeds_comment_processor.install

File

feeds_comment_processor.install
View source
<?php

/**
 * Implementation of hook_schema().
 */
function feeds_comment_processor_schema() {
  $schema = array();
  $schema['feeds_comment_item'] = array(
    'description' => t('Stores additional information about feed item comments. Used by FeedsCommentProcessor.'),
    'fields' => array(
      'cid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => t("Primary Key: The feed item comment's cid."),
      ),
      'id' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The id of the fields object that is the producer of this item.',
      ),
      'feed_nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => t("Node id of the owner feed, if available."),
        'default' => 0,
      ),
      'imported' => 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.'),
      ),
      'hash' => array(
        'type' => 'varchar',
        'length' => 32,
        // The length of an MD5 hash.
        'not null' => TRUE,
        'default' => '',
        'description' => t('The hash of the item.'),
      ),
    ),
    'primary key' => array(
      'cid',
    ),
    'indexes' => array(
      'id' => array(
        'id',
      ),
      'feed_nid' => array(
        'feed_nid',
      ),
      'imported' => array(
        'imported',
      ),
      'guid' => array(
        array(
          'guid',
          255,
        ),
      ),
    ),
  );
  return $schema;
}

/**
 * Implementation of hook_install().
 */
function feeds_comment_processor_install() {

  // Create tables.
  drupal_install_schema('feeds_comment_processor');
}

/**
 * Implementation of hook_uninstall().
 */
function feeds_comment_processor_uninstall() {

  // Remove tables.
  drupal_uninstall_schema('feeds_comment_processor');
}

Functions