diff --git a/Command/DatabaseDropCommand.php b/Command/DatabaseDropCommand.php index 148ec4a..b5ba995 100644 --- a/Command/DatabaseDropCommand.php +++ b/Command/DatabaseDropCommand.php @@ -45,6 +45,14 @@ EOT protected function execute(InputInterface $input, OutputInterface $output) { if ($input->getOption('force')) { + if ('prod' === $this->getApplication()->getKernel()->getEnvironment()) { + $this->writeSection($output, 'WARNING: you are about to drop a database in production !', 'bg=red;fg=white'); + if (false === $this->askConfirmation($output, 'Are you sure ? (y/n) ', false)) { + $output->writeln('Aborted, nice decision !'); + return -2; + } + } + $this->writeSection($output, '[Propel] You are running the command: propel:database:drop'); list($name, $config) = $this->getConnection($input, $output);