View source
<?php
function tweet_feed_schema() {
$schema['tweet_feed'] = array(
'description' => 'A cache for twitter feeds.',
'fields' => array(
'tweet_id' => array(
'description' => 'The twitter tweet id for this tweet.',
'type' => 'int',
'size' => 'big',
'not null' => FALSE,
),
'tweet' => array(
'description' => 'The text of the tweet.',
'type' => 'text',
'size' => 'normal',
'not null' => TRUE,
),
'created_at' => array(
'description' => 'The date the tweet was posted (timestamp)',
'type' => 'int',
'length' => 11,
'not null' => TRUE,
),
'user_id' => array(
'description' => 'The user ID of the poster',
'type' => 'varchar',
'length' => 24,
'not null' => TRUE,
),
'profile_image_url' => array(
'description' => 'The URL of the image for the poster of this tweet',
'type' => 'text',
'size' => 'normal',
'not null' => TRUE,
),
'profile_image_https_url' => array(
'description' => 'The secure URL of the image for the poster of this tweet',
'type' => 'text',
'size' => 'normal',
'not null' => TRUE,
),
'screen_name' => array(
'description' => 'The screen name of the person tweeting',
'type' => 'varchar',
'length' => 24,
'not null' => TRUE,
),
'hashtags' => array(
'description' => 'A comma separated list of hashtags without the hash.',
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
),
),
'primary key' => array(
'tweet_id',
),
);
return $schema;
}
function tweet_feed_install() {
drupal_install_schema('tweet_feed');
}
function tweet_feed_uninstall() {
drupal_uninstall_schema('tweet_feed');
variable_del('tweet_feed_consumer_key');
variable_del('tweet_feed_consumer_key');
variable_del('tweet_feed_consumer_secret');
variable_del('tweet_feed_oauth_token');
variable_del('tweet_feed_oauth_token_secret');
variable_del('tweet_feed_query_type');
variable_del('tweet_feed_search_query');
variable_del('tweet_feed_user_id');
variable_del('tweet_feed_pull_count');
variable_del('tweet_feed_new_window');
variable_del('tweet_feed_truncate');
}