Specify database connection when migrating

Sorry about the previous PR I accidentally pushed some mistakes.

This PR adds the configured database connection to the migrations.