public function execute($command, $edition = null)
    {
        $migrationPaths = $this->getMigrationPaths($edition);

        foreach ($migrationPaths as $migrationEdition => $migrationPath) {

            $doctrineApplication = $this->doctrineApplicationBuilder->build();

            $input = $this->formDoctrineInput($command, $migrationPath, $this->dbFilePath);

            if ($this->shouldRunCommand($command, $migrationPath)) {
                $errorCode = $doctrineApplication->run($input, $this->output);
                if ($errorCode) {
                    return $errorCode;
                }
            }
        }

        return 0;
    }