/
MigrationsDiffDoctrineCommand.php
41 lines (33 loc) · 1.46 KB
/
MigrationsDiffDoctrineCommand.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace Doctrine\Bundle\MigrationsBundle\Command;
use Doctrine\Migrations\Tools\Console\Command\DiffCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Command for generate migration classes by comparing your current database schema
* to your mapping information.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jonathan H. Wage <jonwage@gmail.com>
*/
class MigrationsDiffDoctrineCommand extends DiffCommand
{
protected function configure() : void
{
parent::configure();
$this
->setName('doctrine:migrations:diff')
->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.')
->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.')
->addOption('shard', null, InputOption::VALUE_REQUIRED, 'The shard connection to use for this command.')
;
}
public function initialize(InputInterface $input, OutputInterface $output) : void
{
Helper\DoctrineCommandHelper::setApplicationHelper($this->getApplication(), $input);
$configuration = $this->getMigrationConfiguration($input, $output);
DoctrineCommand::configureMigrations($this->getApplication()->getKernel()->getContainer(), $configuration);
parent::initialize($input, $output);
}
}