doctrine/DoctrineMigrationsBundle

Error when running 'diff' and 'migrate' at the same thread

sunchuo opened this issue · 1 comments

$makeMigrationCommand = $this->getApplication()->find('doctrine:migrations:diff');
$makeMigrationCommandInput = new ArgvInput(['--no-interaction' => true]);
$makeMigrationCommand->run($makeMigrationCommandInput, $output);


$listMigrationsCommand = $this->getApplication()->find('doctrine:migrations:list');
$listMigrationsCommandInput = new ArgvInput([]);
$listMigrationsCommand->run($listMigrationsCommandInput, $output);

$migrateCommand = $this->getApplication()->find('doctrine:migrations:migrate');
$migrateCommandInput = new ArgvInput(['--no-interaction' => true]);
$migrateCommandInput->setInteractive(false);
$migrateCommand->run($migrateCommandInput, $output);

output:


 Generated new migration class to "/skeleton/migrations/Version20240414110144.php"
 
 To run just this migration for testing purposes, you can use migrations:execute --up 'DoctrineMigrations\\Version20240414110144'
 
 To revert the migration you can use migrations:execute --down 'DoctrineMigrations\\Version20240414110144'


+-----------+--------+-------------+----------------+-------------+
| Migration Versions                                |             |
+-----------+--------+-------------+----------------+-------------+
| Migration | Status | Migrated At | Execution Time | Description |
+-----------+--------+-------------+----------------+-------------+

 [ERROR] The version "latest" couldn't be reached, there are no registered migrations.                                  

It used to be okay to do that.
The new version will have problems.

Generated migration files don't seem to be loaded.
FilesystemMigrationsRepository::loadMigrationsFromDirectories is only run once.

Seems to be an issue with doctrine/migrations, so close this.

doctrine/migrations#1422