【发布时间】:2012-01-26 16:47:36
【问题描述】:
我正在使用 Play Framework (1.2.4) 我创建了一个 UserAccount 对象,并将其部署到 Heroku。工作得很好。然后我在UserAccount 类中添加了一个isAdmin 字段,在本地部署它并且工作正常(但我使用的是内存数据库),然后我将它部署在Heroku 上,现在我得到了以下异常:
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
...
我四处寻找如何进行数据库升级,Play 网站说 Hibernate 应该为我处理这个问题。
这是我的数据库属性:
%prod.db=${DATABASE_URL}
%prod.jpa.dialect=org.hibernate.dialect.PostgreSQLDialect
%prod.jpa.ddl=update
我做错了什么?感谢您的帮助。
【问题讨论】:
标签: java heroku playframework