I’m using the Play Framework (1.2.4) I created a UserAccount object, deployed it to Heroku. Worked great. Then I added an isAdmin field to the UserAccount class, deployed it locally and it worked fine (but I’m using the in-memory DB), then I deployed it on Heroku and now I’m getting the following exception:
2011-12-23T09:03:35+00:00 app[web.1]: play.exceptions.JavaExecutionException: org.hibernate.exception.SQLGrammarException: could not load an entity: [models.UserAccount#2]
2011-12-23T09:03:35+00:00 app[web.1]: PersistenceException occured : org.hibernate.exception.SQLGrammarException: could not load an entity: [models.UserAccount#2]
...
2011-12-23T09:03:35+00:00 app[web.1]: Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not load an entity: [models.UserAccount#2]
2011-12-23T09:03:35+00:00 app[web.1]: Caused by: org.hibernate.exception.SQLGrammarException: could not load an entity: [models.UserAccount#2]
2011-12-23T09:03:35+00:00 app[web.1]: Caused by: org.postgresql.util.PSQLException: ERROR: column useraccoun0_.isadmin does not exist
...
I’ve searched around to figure out how to do DB upgrades and the Play website says that Hibernate should be handling that for me.
Here are my DB properties:
%prod.db=${DATABASE_URL}
%prod.jpa.dialect=org.hibernate.dialect.PostgreSQLDialect
%prod.jpa.ddl=update
What am I doing wrong? Thanks for the help.
You need to run the Play database evolutions on Heroku: