You are here

function twitter_block_schema in Twitter Block 6

Same name and namespace in other branches
  1. 7.2 twitter_block.install \twitter_block_schema()
  2. 7 twitter_block.install \twitter_block_schema()

Implementation of hook_schema().

File

./twitter_block.install, line 11
Install, update and uninstall functions for the twitter_block module.

Code

function twitter_block_schema() {
  $schema['twitter_block'] = array(
    'description' => 'The table for storing twitter blocks.',
    'fields' => array(
      'delta' => array(
        'description' => 'The machine identifier for a twitter block.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'search_type' => array(
        'description' => 'The search type for this block. ie. mention, reply',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => 'search',
      ),
      'include_rts' => array(
        'description' => 'Whether retweets should be included in the search results. (1 = enabled, 0 = disabled)',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 1,
        'size' => 'tiny',
      ),
      'search_string' => array(
        'description' => 'The search string.',
        'type' => 'varchar',
        'length' => 140,
        'not null' => TRUE,
        'default' => '',
      ),
      'default_title' => array(
        'description' => 'The title of this block in plain text.',
        'type' => 'varchar',
        'length' => 140,
        'not null' => TRUE,
        'default' => '',
      ),
      'results_per_page' => array(
        'description' => '"Returns per page" from the Twitter Search API.',
        'type' => 'varchar',
        'length' => 8,
      ),
      'lang' => array(
        'description' => 'Optional Twitter language filter.',
        'type' => 'varchar',
        'length' => 2,
      ),
    ),
    'unique keys' => array(
      'delta' => array(
        'delta',
      ),
    ),
    'foreign keys' => array(
      'block' => array(
        'table' => 'block',
        'columns' => array(
          'bid' => 'bid',
        ),
      ),
    ),
    'primary key' => array(
      'delta',
    ),
  );
  return $schema;
}