From d4d981a25c6252fb2f5477be04f3ab77af6b17a8 Mon Sep 17 00:00:00 2001 From: William DURAND Date: Wed, 2 Feb 2011 02:06:38 +0100 Subject: [PATCH] Added a new command : propel:generate-diff --- Command/GenerateDiffCommand.php | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Command/GenerateDiffCommand.php diff --git a/Command/GenerateDiffCommand.php b/Command/GenerateDiffCommand.php new file mode 100644 index 0000000..d2a9693 --- /dev/null +++ b/Command/GenerateDiffCommand.php @@ -0,0 +1,51 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +/** + * GenerateDiffCommand. + * + * @author William DURAND + */ +class GenerateDiffCommand extends PhingCommand +{ + /** + * @see Command + */ + protected function configure() + { + $this + ->setDescription('Generates SQL diff between the XML schemas and the current database structure') + ->setHelp(<<propel:generate-diff command compares the current database structure and the available schemas. If there is a difference, it creates a migration file. + + php app/console propel:generate-diff +EOT + ) + ->setName('propel:generate-diff') + ; + } + + /** + * @see Command + * + * @throws \InvalidArgumentException When the target directory does not exist + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->callPhing('diff'); + } +}