Skip to content

Commit e8951d7

Browse files
#86: Include database name in confirmation message for sql-drop.
1 parent 7c46e66 commit e8951d7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

commands/sql/sql.drush.inc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -934,11 +934,15 @@ function _drush_sql_query($query, $db_spec = NULL, $filename = NULL) {
934934
* Drops all tables in the database.
935935
*/
936936
function drush_sql_drop() {
937-
if (!drush_confirm(dt('Do you really want to drop all tables?'))) {
937+
drush_sql_bootstrap_further();
938+
$db_spec = _drush_sql_get_db_spec();
939+
if (!$db_spec) {
940+
return drush_set_error('DRUSH_SQL_NO_DATABASE', dt("No database to operate on."));
941+
}
942+
if (!drush_confirm(dt('Do you really want to drop all tables in the database !db?', array('!db' => $db_spec['database'])))) {
938943
return drush_user_abort();
939944
}
940-
drush_sql_bootstrap_further();
941-
_drush_sql_drop();
945+
_drush_sql_drop($db_spec);
942946
}
943947

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

0 commit comments

Comments
 (0)