SONAR-4996 Improve migrations