Joe*_*oel 4 java heroku playframework
我正在使用Play Framework(1.2.4)我创建了一个UserAccount对象,将其部署到Heroku.工作得很好.然后我isAdmin在UserAccount类中添加了一个字段,在本地部署它并且工作正常(但我使用的是内存中的数据库),然后我将它部署在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
...
Run Code Online (Sandbox Code Playgroud)
我一直在寻找如何进行数据库升级,Play网站说Hibernate应该为我处理这个问题.
这是我的数据库属性:
%prod.db=${DATABASE_URL}
%prod.jpa.dialect=org.hibernate.dialect.PostgreSQLDialect
%prod.jpa.ddl=update
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?谢谢您的帮助.
您需要在Heroku上运行Play数据库演变:
heroku run "play evolutions:apply --%prod"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2188 次 |
| 最近记录: |