Skip to content

Commit 428f653

Browse files
committed
Merge remote-tracking branch 'origin/4.x' into 5.x
# Conflicts: # docs/config/all.py
2 parents 052b17f + 2c1f782 commit 428f653

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

docs/config/all.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{'name': '2.x', 'number': 'migrations/2', 'title': '2.x'},
2727
{'name': '3.x', 'number': 'migrations/3', 'title': '3.x'},
2828
{'name': '4.x', 'number': 'migrations/4', 'title': '4.x'},
29-
{'name': '4.x', 'number': 'migrations/5', 'title': '5.x', 'current': True},
29+
{'name': '5.x', 'number': 'migrations/5', 'title': '5.x', 'current': True},
3030
]
3131

3232
# Languages available.

src/Command/DumpCommand.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ public function execute(Arguments $args, ConsoleIo $io): ?int
112112
]);
113113
$config = $factory->createConfig();
114114
$path = $config->getMigrationPath();
115+
116+
if (!is_dir($path)) {
117+
$io->verbose('<info>No migrations directory found, skipping dump.</info>');
118+
119+
return self::CODE_SUCCESS;
120+
}
115121
$connectionName = (string)$config->getConnection();
116122
$connection = ConnectionManager::get($connectionName);
117123
assert($connection instanceof Connection);

tests/TestCase/Command/DumpCommandTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ public function testExecuteSuccess(): void
8181
$this->assertEquals(['id', 'letter'], $generatedDump['letters']->columns());
8282
}
8383

84+
public function testExecuteNoMigrationsDirectory(): void
85+
{
86+
$this->exec('migrations dump --connection test --source NonExistentMigrations');
87+
88+
$this->assertExitSuccess();
89+
}
90+
8491
public function testExecutePlugin(): void
8592
{
8693
$this->loadPlugins(['Migrator']);

0 commit comments

Comments
 (0)