Migration handler can be defined on component class and configuration type classes (datastore, dataset).
To perform a migration correctly all the defined migration handlers need to be called in a specific order to ensure a correct migration this is something already implemented
Here is an example to shows better the concept.
Let's assume that we have a component XXInput with a configuration XXDataset that contains a nested configuration XXDatastore that itself contains a nested configuration XXConfig.
--XXInput --> version 1
— XXDataset --> version 2
----------XXDatastore --> version 3 ⇱
Each of those levels can have a different version and a different migration handler
Any of those configuration can evolve in the life of a component and we need to handle the migration at each level.
In a situation where all the version evolve :
--XXInput --> version 1'
— XXDataset --> version 2'
----------XXDatastore --> version 3' ⇱
We must call each migration handler with the corresponding version and the right config path according to it level. this is already done also
What we are missing ?
We need to serialize the version of each configuration type to be able to reuse it at the migration time.