From 0c439e39618362eafb1f61ee76217175f7dd7e87 Mon Sep 17 00:00:00 2001 From: Robert Gruber Date: Thu, 24 Aug 2017 19:11:45 +0200 Subject: [PATCH 1/2] Hello spaceship --- lib/Console/Command/AbstractCommand.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/Console/Command/AbstractCommand.php b/lib/Console/Command/AbstractCommand.php index 9f5438a..0a30144 100644 --- a/lib/Console/Command/AbstractCommand.php +++ b/lib/Console/Command/AbstractCommand.php @@ -76,11 +76,7 @@ protected function getMigrations(array $directories): array $this->output->writeln("✓ Found {$migrationClassesCount} valid migration classes", 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("✓ Reordered all migration classes according to their create date", OutputInterface::VERBOSITY_VERBOSE); From 5f0ebe8b59498212c5fc38653d1e6a447ebcaaaa Mon Sep 17 00:00:00 2001 From: Robert Gruber Date: Thu, 24 Aug 2017 19:11:53 +0200 Subject: [PATCH 2/2] Fix wrong command help --- lib/Console/Command/VersionsCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Console/Command/VersionsCommand.php b/lib/Console/Command/VersionsCommand.php index 9969cc0..fdcbba6 100644 --- a/lib/Console/Command/VersionsCommand.php +++ b/lib/Console/Command/VersionsCommand.php @@ -64,11 +64,11 @@ protected function configure() ->setHelp(<<%command.name% command allows you to manually add, delete or synchronize migrations from the version collection: - %command.full_name% DATABASE_NAME MIGRATION_ID /path/to/migrations --add + %command.full_name% DATABASE_NAME /path/to/migrations --id=MIGRATION_ID --add If you want to delete a version you can use the --delete option: - %command.full_name% DATABASE_NAME MIGRATION_ID /path/to/migrations --delete + %command.full_name% DATABASE_NAME /path/to/migrations --id=MIGRATION_ID --delete If you want to synchronize by adding or deleting all migrations available in the version collection you can use the --all option: