Skip to content

Commit

Permalink
Merge pull request #11 from gruberro/add-changes-from-pr-feedback
Browse files Browse the repository at this point in the history
Minor improvements
  • Loading branch information
gruberro authored Aug 24, 2017
2 parents e33bd55 + 5f0ebe8 commit bb2de92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions lib/Console/Command/AbstractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,7 @@ protected function getMigrations(array $directories): array
$this->output->writeln("<info>✓ Found {$migrationClassesCount} valid migration classes</info>", OutputInterface::VERBOSITY_VERBOSE);

uasort($migrations, function (MongoDbMigrations\MigrationInterface $a, MongoDbMigrations\MigrationInterface $b) {
if ($a->getCreateDate() === $b->getCreateDate()) {
return 0;
}

return $a->getCreateDate() < $b->getCreateDate() ? -1 : 1;
return $a->getCreateDate() <=> $b->getCreateDate();
});

$this->output->writeln("<info>✓ Reordered all migration classes according to their create date</info>", OutputInterface::VERBOSITY_VERBOSE);
Expand Down
4 changes: 2 additions & 2 deletions lib/Console/Command/VersionsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ protected function configure()
->setHelp(<<<EOT
The <info>%command.name%</info> command allows you to manually add, delete or synchronize migrations from the version collection:
<info>%command.full_name% DATABASE_NAME MIGRATION_ID /path/to/migrations --add</info>
<info>%command.full_name% DATABASE_NAME /path/to/migrations --id=MIGRATION_ID --add</info>
If you want to delete a version you can use the <comment>--delete</comment> option:
<info>%command.full_name% DATABASE_NAME MIGRATION_ID /path/to/migrations --delete</info>
<info>%command.full_name% DATABASE_NAME /path/to/migrations --id=MIGRATION_ID --delete</info>
If you want to synchronize by adding or deleting all migrations available in the version collection you can use the <comment>--all</comment> option:
Expand Down

0 comments on commit bb2de92

Please sign in to comment.