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
john asked 2 weeks 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
naveen answered 2 weeks ago
Your Answer

7 + 0 =

Popular Tags

WP Facebook Auto Publish Powered By :