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
check if filename has extension, if not add it
revert changes in 1e4885c