From 3018a9e9777a86ab2d5d705f348fa69471b5a973 Mon Sep 17 00:00:00 2001 From: jwage Date: Wed, 23 Jan 2008 03:40:13 +0000 Subject: [PATCH] fixes #692 --- lib/Doctrine/Task/DropDb.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/Doctrine/Task/DropDb.php b/lib/Doctrine/Task/DropDb.php index daa7195c6..3c982478c 100644 --- a/lib/Doctrine/Task/DropDb.php +++ b/lib/Doctrine/Task/DropDb.php @@ -34,16 +34,18 @@ class Doctrine_Task_DropDb extends Doctrine_Task { public $description = 'Drop database for all existing connections', $requiredArguments = array(), - $optionalArguments = array(); + $optionalArguments = array('force' => 'Whether or not to force the drop database task'); public function execute() { - $answer = $this->ask('Are you sure you wish to drop your databases? (y/n)'); - - if ($answer != 'y') { - $this->notify('Successfully cancelled'); - - return; + if ( ! $this->getArgument('force')) { + $answer = $this->ask('Are you sure you wish to drop your databases? (y/n)'); + + if ($answer != 'y') { + $this->notify('Successfully cancelled'); + + return; + } } $results = Doctrine::dropDatabases();