Open Herz3h opened 11 months ago
When upgrading to a new major version, you need to run doctrine:migrations:sync-metadata-storage
command to migrate the metadata storage to the new format.
doctrine:migrations:status
does not automatically migrate the stored metadata (note that any command that modify metadata due to executing some migrations will trigger a storage sync first to ensure they don't corrupt the storage by having a mix of versions).
Apologies, I forgot to mention that I had already run that sync command, yet the problem remains. Is the sync command supposed to update the version
column in the database with the namespace ?
it should, yes
BC Break Report
I upgraded from doctrine/migrations 2.3.4 to 3.5.5 breaks migrations detections
Summary
Introduction of
migration_paths
breaks detection of executed migrations.Before upgrade, I had this configuration (yaml):
After upgrade:
Previous behavior
Running doctrine:migration:status previously reported migrations as executed.
Current behavior
Running doctrine:migration:status now, shows that all my migrations are not executed.
How to reproduce
Install migration v2.3.4, execute some migrations then upgrade to v3.5.5.
Upon digging, it seems the problem is upon using ReflectionClass, getName returns the FQDN of the class instead of the short class name (maybe it used to do this before?):
https://github.com/doctrine/migrations/blob/832ef284bb12bb896202d887cc45db22d104a2ce/lib/Doctrine/Migrations/Finder/Finder.php#L63
Added screenshot of migration_versions table:
Because afterwards it is comparing executed version name vs available version, but they dont match, one has FQDN while in the DB it says Version2023... only without namespace.
Edit: Found the commit that changed the behavior (3.0 release commit): https://github.com/doctrine/migrations/commit/d74785fd5a21d7f7fa2d04f61427c11169cb0ce2#diff-3ba1cb4b1d3fc85dc36972850335e25c1e714e8dad9f794a0ff79ec7b2a2ec94L67