You are here

function twitter_block_schema in Twitter Block 7

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

Implements 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(
      'bid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => "The block's {block}.bid.",
      ),
      'info' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Block description.',
      ),
      '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' => '',
      ),
      '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(
      'info' => array(
        'info',
      ),
    ),
    'primary key' => array(
      'bid',
    ),
  );
  return $schema;
}