Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request #8 from mcrinquand/54_handle_migration_on_install
Browse files Browse the repository at this point in the history
Handle migration on install
  • Loading branch information
nicolas-bastien committed Mar 8, 2015
2 parents 77da390 + 16669eb commit f6964b7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Command/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public function execute(InputInterface $input, OutputInterface $output)
if ($this->getConfigurationManager()->isPhpcrEnabled()) {
$this->installPhpcr();
}
if ($this->getConfigurationManager()->isMigrationEnabled()) {
$this->installMigration();
}
}

/**
Expand Down Expand Up @@ -83,4 +86,23 @@ protected function installPhpcr()

$this->log('Install PHPCR done..');
}

/**
* Set all migration as executed
*/
protected function installMigration()
{
$this->log('Set all migration as executed ..');

$application = $this->getApplication();
$commandInput = new ArrayInput(array(
'command' => 'doctrine:migration:version',
'--add' => true,
'--all' => true,
'--no-interaction' => true
));
$application->doRun($commandInput, $this->output);

$this->log('Set all migration as executed done..');
}
}

0 comments on commit f6964b7

Please sign in to comment.