Try to search your question here, if you can't find : Ask Any Question Now ?

Run migrations when deploying golang application to Heroku

HomeCategory: stackoverflowRun migrations when deploying golang application to Heroku
Avatarjohn asked 5 months ago

I’ve been trying to set up migrations for a golang application on Heroku. I’m using native Go modules (vgo) and the official Heroku build pack. For migrations I’m using the migrate package.

The thing is, I could run migrations when the main function runs, but it feels a bit hacky, this would mean that every time the app restarts it will run the migrations. I would prefer to just run the schema migration when deploying.

I’m not sure how this can be accomplished, when I log in to the instance the go binary is not installed, it’s like the build pack only executes the main function.

I could live with doing it with a Heroku CLI command but I can’t find how to do this in the docs nor via Google.

1 Answers
Best Answer
Avatarnaveen answered 5 months ago
Your Answer

0 + 6 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com