Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand::configure PHP Method

configure() protected method

protected configure ( )
    protected function configure()
    {
        $this
            ->setName('migrations:execute')
            ->setDescription('Execute a single migration version up or down manually.')
            ->addArgument('version', InputArgument::REQUIRED, 'The version to execute.', null)
            ->addOption('write-sql', null, InputOption::PARAMETER_NONE, 'The path to output the migration SQL file instead of executing it.')
            ->addOption('dry-run', null, InputOption::PARAMETER_NONE, 'Execute the migration as a dry run.')
            ->addOption('up', null, InputOption::PARAMETER_NONE, 'Execute the migration down.')
            ->addOption('down', null, InputOption::PARAMETER_NONE, 'Execute the migration down.')
            ->setHelp(<<<EOT
The <info>%command.name%</info> command executes a single migration version up or down manually:

    <info>%command.full_name% YYYYMMDDHHMMSS</info>

If no <comment>--up</comment> or <comment>--down</comment> option is specified it defaults to up:

    <info>%command.full_name% YYYYMMDDHHMMSS --down</info>

You can also execute the migration as a <comment>--dry-run</comment>:

    <info>%command.full_name% YYYYMMDDHHMMSS --dry-run</info>

You can output the would be executed SQL statements to a file with <comment>--write-sql</comment>:

    <info>%command.full_name% YYYYMMDDHHMMSS --write-sql</info>

Or you can also execute the migration without a warning message wich you need to interact with:

    <info>%command.full_name% --no-interaction</info>
EOT
        );

        parent::configure();
    }

Usage Example

 protected function configure()
 {
     parent::configure();
     $this->setName('doctrine:migrations:execute')->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command.');
 }
All Usage Examples Of Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand::configure
ExecuteCommand