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.
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:
This should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With