Command db:migrate should work even if DB_RUN_MIGRATIONS is false

Fixes #4818
This commit is contained in:
Frédéric Guillot 2023-02-12 19:37:15 -08:00 committed by Frédéric Guillot
parent bd8bcfbc37
commit 277357277f
1 changed files with 9 additions and 2 deletions

11
cli
View File

@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\EventDispatcher\Event;
if (php_sapi_name() !== 'cli') {
@ -10,8 +11,14 @@ if (php_sapi_name() !== 'cli') {
try {
require __DIR__.'/app/common.php';
$container['dispatcher']->dispatch('app.bootstrap', new Event);
$container['cli']->run();
$input = new ArgvInput();
if (! in_array($input->getFirstArgument(), ['db:migrate', 'db:version'])) {
$container['dispatcher']->dispatch('app.bootstrap', new Event);
}
$container['cli']->run($input);
} catch (Exception $e) {
echo $e->getMessage().PHP_EOL;
exit(255);