diff --git a/Command/TableDropCommand.php b/Command/TableDropCommand.php index 264b227..c5c6c22 100644 --- a/Command/TableDropCommand.php +++ b/Command/TableDropCommand.php @@ -10,6 +10,7 @@ namespace Propel\PropelBundle\Command; +use Propel\Runtime\Adapter\Pdo\MysqlAdapter; use Propel\Runtime\Propel; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Component\Console\Input\InputArgument; @@ -44,10 +45,15 @@ class TableDropCommand extends ContainerAwareCommand */ protected function execute(InputInterface $input, OutputInterface $output) { - if (!$input->getOption('force')) { - $output->writeln('You have to use the "--force" option to drop some tables.'); + $connection = Propel::getConnection($input->getOption('connection')); + $adapter = Propel::getAdapter($connection->getName()); - return; + if (!$adapter instanceof MysqlAdapter) { + return $output->writeln('This command is MySQL only.'); + } + + if (!$input->getOption('force')) { + return $output->writeln('You have to use the "--force" option to drop some tables.'); } $tablesToDelete = $input->getArgument('table'); @@ -71,9 +77,6 @@ class TableDropCommand extends ContainerAwareCommand } try { - $connection = Propel::getConnection($input->getOption('connection')); - $adapter = Propel::getAdapter($connection->getName()); - $showStatement = $connection->prepare('SHOW TABLES;'); $showStatement->execute();