'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.', ), 'widget_id' => array( 'type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => '', 'description' => 'Widget ID.', ), 'username' => array( 'type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => '', 'description' => 'Account username.', ), 'data' => array( 'type' => 'blob', 'size' => 'big', 'not null' => TRUE, 'serialize' => TRUE, 'description' => 'Serialized data containing the timeline properties.', ), ), 'unique keys' => array( 'info' => array('info'), 'widget_id' => array('widget_id'), ), 'primary key' => array('bid'), ); return $schema; } /** * Implements hook_uninstall(). */ function twitter_block_uninstall() { // Remove blocks. db_delete('block') ->condition('module', 'twitter_block') ->execute(); db_delete('block_role') ->condition('module', 'twitter_block') ->execute(); // Remove variables. variable_del('twitter_block_cache'); variable_del('twitter_block_last_cache'); // Remove the cache directory. twitter_block_clear_js_cache(); // Clear the site cache. cache_clear_all(); } /** * Remove any old Twitter Block blocks and install the new Twitter Block schema. */ function twitter_block_update_7200() { // Remove old Twitter Block schema. drupal_uninstall_schema('twitter_block'); // Remove any old Twitter Block blocks. db_delete('block') ->condition('module', 'twitter_block') ->execute(); db_delete('block_role') ->condition('module', 'twitter_block') ->execute(); // Clear the site cache. cache_clear_all(); // Install the new Twitter Block schema. drupal_install_schema('twitter_block'); return t('Removed any old Twitter Block blocks and installed the new Twitter Block schema.'); } /** * Add a column to the {twitter_block} table to store the Twitter account username. */ function twitter_block_update_7201() { db_add_field('twitter_block', 'username', array( 'type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => '', 'description' => 'Account username.', )); }