fix db connections for migrations
moved deletion of old migration file into upgrade check
This line was causing issues with the connection name being saved in the top level config directory as that
file would be deleted every time migration was loaded