. */ namespace Doctrine\ORM\Tools\Console\Command\SchemaTool; use Symfony\Components\Console\Input\InputArgument, Symfony\Components\Console\Input\InputOption, Symfony\Components\Console\Input\InputInterface, Symfony\Components\Console\Output\OutputInterface, Doctrine\ORM\Tools\SchemaTool; /** * Command to drop the database schema for a set of classes based on their mappings. * * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link www.doctrine-project.org * @since 2.0 * @version $Revision$ * @author Benjamin Eberlei * @author Guilherme Blanco * @author Jonathan Wage * @author Roman Borschel */ class DropCommand extends AbstractCommand { /** * @see Console\Command\Command */ protected function configure() { $this ->setName('orm:schema-tool:drop') ->setDescription( 'Processes the schema and either drop the database schema of EntityManager Storage Connection or generate the SQL output.' ) ->setDefinition(array( new InputOption( 'dump-sql', null, InputOption::PARAMETER_NONE, 'Instead of try to apply generated SQLs into EntityManager Storage Connection, output them.' ) )) ->setHelp(<<getOption('dump-sql') === true) { $sqls = $schemaTool->getDropSchemaSql($metadatas); $output->write(implode(';' . PHP_EOL, $sqls) . PHP_EOL); } else { $output->write('Dropping database schema...' . PHP_EOL); $schemaTool->dropSchema($metadatas); $output->write('Database schema dropped successfully!' . PHP_EOL); } } }