I have more than 10 different Ruby on Rails apps where I have to deploy the same code. I have connected the git repo to my Heroku apps, so whenever I push new changes it deploys on all of them.
The issue is with the database migration step. I want to run migrations automatically after each deployment. None of custom build pack is working. Can someone please help me? I am using rails 4 and spree.
So far, I have tried:
This solution is not working.
Is there any other solution to run Rails migrations on Heroku automatically?
No need to use gems or write scripts. Heroku has a 'release' phase features (https://devcenter.heroku.com/articles/release-phase).
Thank to this, you just have to add to your Procfile
some code to automatically run rails db:migrate
to all your push:
# cat Procfile
release: bundle exec rails db:migrate