Consolidate migrations

This solves issue 5163