Play Framework DB upgrades with Heroku Play Framework DB upgrades with Heroku heroku heroku

Play Framework DB upgrades with Heroku


The property jpa.ddl should be none when in Prod mode. Update is risky in production as it may break the DB (as it seems it's happening to you!

The proper way to manage this would be:

  1. Install Heroku SQL console on your Heroku app (from here)
  2. Change jpa.ddl to none
  3. Connect to your heroku database using the SQL console and apply any fixes/updates you have to
  4. Reupload the app to Heroku (remember to do a new commit locally or Heroku will say the code is already up to date)

This should work.


You need to run the Play database evolutions on Heroku:

heroku run "play evolutions:apply --%prod"


Just a note, the instruction for heroku have you include db in your .gitignore, so if you use this:

heroku run "play evolutions:apply --%prod"

You will get an error/warning. However, to my surprise (and delight) restarting the process did indeed apply my evolutions and updated my db (verified with heroku SQL console mentioned below :-)). A bit mysterious how this worked, but happy it did!