diff --git a/src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php b/src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php index 542c6702ca..235e40b0df 100644 --- a/src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php +++ b/src/bundle/RepositoryInstaller/Command/InstallPlatformCommand.php @@ -16,6 +16,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\BufferedOutput; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; use Symfony\Component\Process\PhpExecutableFinder; use Symfony\Component\Process\Process; @@ -84,6 +85,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->checkParameters(); $this->checkCreateDatabase($output); + $schemaManager = $this->connection->getSchemaManager(); + if (!empty($schemaManager->listTables())) { + $helper = $this->getHelper('question'); + $question = new ConfirmationQuestion('Running this command will delete current data in database. Continue?'); + + if (!$helper->ask($input, $output, $question)) { + return 0; + } + } + $type = $input->getArgument('type'); $siteaccess = $input->getOption('siteaccess'); $installer = $this->getInstaller($type);