You are here

function wordstream_schema in WordStream Keyword Tools 6

Same name and namespace in other branches
  1. 7 wordstream.install \wordstream_schema()

Implementation of hook_schema

File

./wordstream.install, line 29
Install file.

Code

function wordstream_schema() {
  $schema['wordstream_cache'] = array(
    'description' => 'Creates database table to store wordstream data.',
    'fields' => array(
      'keyphrase' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'target keyphrase.',
      ),
      //keyphrase
      'adult_filter' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 1,
        'description' => 'timestamp of last data update',
      ),
      //adult_filter
      'api_call' => array(
        'type' => 'varchar',
        'length' => '64',
        'not null' => TRUE,
        'default' => '',
        'description' => 'API call',
      ),
      //function
      'updated' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
        'description' => 'timestamp of last data update',
      ),
      //stats_update
      'data' => array(
        'type' => 'text',
        'description' => t('result from api call'),
      ),
    ),
    'primary key' => array(
      'keyphrase',
      'adult_filter',
      'api_call',
    ),
  );
  return $schema;
}