*/ class MigrationMigrateCommand extends AbstractPropelCommand { /** * @see Command */ protected function configure() { $this ->setDescription('Executes the next migrations up') ->setDefinition(array( new InputOption('--up', '', InputOption::VALUE_NONE, 'Executes the next migration up'), new InputOption('--down', '', InputOption::VALUE_NONE, 'Executes the next migration down'), )) ->setHelp(<<propel:migration:migrate command checks the version of the database structure, looks for migrations files not yet executed (i.e. with a greater version timestamp), and executes them. php app/console propel:migration:migrate [--up] [--down] php app/console propel:migration:migrate : is the default command, it executes all migrations files. php app/console propel:migration:migrate --up : checks the version of the database structure, looks for migrations files not yet executed (i.e. with a greater version timestamp), and executes the first one of them. php app/console propel:migration:migrate --down : checks the version of the database structure, and looks for migration files already executed (i.e. with a lower version timestamp). The last executed migration found is reversed. EOT ) ->setName('propel:migration:migrate') ; } /** * @see Command * * @throws \InvalidArgumentException When the target directory does not exist */ protected function execute(InputInterface $input, OutputInterface $output) { if ($input->getOption('down')) { $this->callPhing('migration-down'); } else if($input->getOption('up')) { $this->callPhing('migration-up'); } else { $this->callPhing('migrate'); } $this->writeSummary($output, 'propel-migration'); } }