'The table to store access information for external databases.', 'fields' => array( 'DatabaseHandle' => array( 'description' => 'The PHP handle for this database.', 'type' => 'varchar', 'length' => 120, 'not null' => TRUE, ), 'DatabaseConnectionInfo' => array( 'description' => 'Serialized array of DB Connection Info.', 'type' => 'blob', 'not null' => TRUE, ), 'in_settings_php' => array( 'type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0, 'description' => 'Whether the aed managed database has' . ' been added to settings.php. 0-False 1-True', ), ), 'primary key' => array( 'DatabaseHandle'), ); return $schema; } /** * Implements hook_install(). */ function aed_install() { global $databases; cache_clear_all('*', 'cache', TRUE); cache_clear_all('*', 'cache_filter', TRUE); cache_clear_all('*', 'cache_menu', TRUE); cache_clear_all('*', 'cache_page', TRUE); } /** * Implements hook_uninstall(). */ function aed_uninstall() { db_drop_table('aed'); // Simple DB query to get the names of your variables. $results = db_select('variable', 'v') ->fields('v', array('name')) ->condition('name', 'aed_%', 'LIKE') ->execute(); // Loop through and delete each of your variables. foreach ($results as $result) { variable_del($result->name); } cache_clear_all('*', 'cache', TRUE); cache_clear_all('*', 'cache_filter', TRUE); cache_clear_all('*', 'cache_menu', TRUE); cache_clear_all('*', 'cache_page', TRUE); } /** * Implements hook_update_n(). */ function aed_update_7100() { // Add the in_settings_php field to the database and set it to false. $field = array( 'type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0, 'description' => 'Whether the aed managed database has' . ' been added to settings.php. 0-False 1-True', ); db_add_field('aed', 'in_settings_php', $field); db_update('aed') ->fields(array( 'in_settings_php' => 0)) ->execute(); }