Open beregovoy opened 3 months ago
I may add tests, if concept will be accepted
Hi @beregovoy
it does make sense to have some expectations about the order of executed, but changing this in version 3.7 would be a bc break. I'd expect that this could be the default comparator in 4.0. A new comparator instance could still be injected manually in older versions though.
Strip namespace, so namespace do not affect version comparsion.
Summary
Previous behaviour Migrations\Version2022 will always migrate AFTER Brand\Migrations\Version2024, but based on pure versions - Version2022 SHOULD be migrated BEFORE Version2024.
ZBrand\Migrations\Version2024 - will migrate AFTER Migrations\Version2022. So comparsion was not actually performed on version, but on namespace first. Which is kind of wrong, non intuitive, and break namespace functional.
New behaviour ignore namespace, and compare versions only by version. Default behaviour should not depend on namespace. If someone need to override it - he should did it explicitly for project.