Open d12 opened 4 years ago
We can add the following release command in our Procfile
and get this working:
release: bin/rails db:migrate
Should we test it on a demo instance of classroom?
Nice, this should work. Do you know if this plays nicely with multiple dynos on Heroku?
Good catch! I'll check it out.
So the Heroku official blog about release phase mentions that release phases run in one-off dynos, which is equivalent to booting up the console and running the migration manually, but ensuring that the deployment will fail if the release phase failed. An example in their blog explains how this works for migrations, which I think is exactly what we need.
Currently, we deploy migration PRs and then
heroku run bundle exec rake db:migrate
to run the migration. We may be able to use https://devcenter.heroku.com/articles/release-phase to automatically run these migrations after the deploy release finishes.