Added a new command : propel:generate-diff
This commit is contained in:
parent
fcaec28f25
commit
d4d981a25c
1 changed files with 51 additions and 0 deletions
51
Command/GenerateDiffCommand.php
Normal file
51
Command/GenerateDiffCommand.php
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
|
||||
namespace Symfony\Bundle\PropelBundle\Command;
|
||||
|
||||
use Symfony\Bundle\PropelBundle\Command\PhingCommand;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony framework.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* GenerateDiffCommand.
|
||||
*
|
||||
* @author William DURAND <william.durand1@gmail.com>
|
||||
*/
|
||||
class GenerateDiffCommand extends PhingCommand
|
||||
{
|
||||
/**
|
||||
* @see Command
|
||||
*/
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setDescription('Generates SQL diff between the XML schemas and the current database structure')
|
||||
->setHelp(<<<EOT
|
||||
The <info>propel:generate-diff</info> command compares the current database structure and the available schemas. If there is a difference, it creates a migration file.
|
||||
|
||||
<info>php app/console propel:generate-diff</info>
|
||||
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');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue