You are here

function contentanalysis_schema in Content Analysis 6

Same name and namespace in other branches
  1. 8 contentanalysis.install \contentanalysis_schema()
  2. 7 contentanalysis.install \contentanalysis_schema()

Implementation of hook_schema()

File

./contentanalysis.install, line 26
Install include file. Implements database schema.

Code

function contentanalysis_schema() {
  $schema['contentanalysis'] = array(
    'description' => t('Creates database table for content analysis settings.'),
    'fields' => array(
      'aid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'The id for the analysis.',
      ),
      //aid
      'last_analysis' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The unix timestamp of the time the analysis was last run.',
      ),
      //last_analysis
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The {node}.nid of an analyzed node.',
      ),
      //nid
      'path' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Drupal path of an analyzed page.',
      ),
      //path
      'url' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'URL of an analyzed page.',
      ),
      //url
      'analyzers' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Analyzers to use with node.',
      ),
    ),
    'primary key' => array(
      'aid',
    ),
    'indexes' => array(
      'nid' => array(
        'nid',
      ),
      'path' => array(
        'path',
      ),
      'url' => array(
        'url',
      ),
    ),
  );
  return $schema;
}