在开发中,Play 会自动在我的数据库中创建缺失的表和索引,但它似乎不想在生产中这样做——这使得设置我的生产数据库变得困难。
我该怎么做?
最佳答案
必须在application.conf中配置
# Specify the ddl generation pattern to use. Set to none to disable it
# (default to update in DEV mode, and none in PROD mode):
# jpa.ddl=update
更新会完成这项工作,但要小心。如果您添加一列或表格,它会正常工作,但不会更多。
关于java - 使用 Play Framework 1.x,如何让 JPA 在生产模式下创建缺失的数据库表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4877040/