【问题标题】:Using Play Framework 1.x, how do I get JPA to create missing DB tables in production mode?使用 Play Framework 1.x,如何让 JPA 在生产模式下创建缺失的数据库表?
【发布时间】:2011-02-02 16:29:15
【问题描述】:

在开发过程中,Play 会自动在我的数据库中创建缺失的表和索引,但它似乎不想在生产中执行此操作 - 这使得设置我的生产数据库变得困难。

我该怎么做?

【问题讨论】:

  • 很好,我根本不知道这是支持的!

标签: java jpa playframework


【解决方案1】:

必须在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

更新会完成这项工作,但要小心。如果您添加列或表,它可以正常工作,但不是更多。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多