Skip to content

Commit

Permalink
#86: Include database name in confirmation message for sql-drop.
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-1-anderson committed Sep 14, 2013
1 parent 51d1f4c commit d8ae4d7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions commands/sql/sql.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -934,11 +934,15 @@ function _drush_sql_query($query, $db_spec = NULL, $filename = NULL) {
* Drops all tables in the database.
*/
function drush_sql_drop() {
if (!drush_confirm(dt('Do you really want to drop all tables?'))) {
drush_sql_bootstrap_further();
$db_spec = _drush_sql_get_db_spec();
if (!$db_spec) {
return drush_set_error('DRUSH_SQL_NO_DATABASE', dt("No database to operate on."));
}
if (!drush_confirm(dt('Do you really want to drop all tables in the database !db?', array('!db' => $db_spec['database'])))) {
return drush_user_abort();
}
drush_sql_bootstrap_further();
_drush_sql_drop();
_drush_sql_drop($db_spec);
}

// n.b. site-install uses _drush_sql_drop as a fallback technique if
Expand Down

0 comments on commit d8ae4d7

Please sign in to comment.