【发布时间】:2019-01-12 11:25:02
【问题描述】:
我正在通过 Spring Boot 在我的 Java 应用程序中使用嵌入式 H2。目前,它在数据库中创建(覆盖)我的表。但是一旦我将它投入生产
我不希望我的表被擦除并重新创建,所以我不会丢失表中以前的数据。但我不确定如何做到这一点。不知道该放什么在线spring.jpa.hibernate.ddl-auto=create。我尝试了验证和其他选项,但没有成功。这是我的application.properties。谢谢
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=create
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.use_sql_comments=true
spring.jpa.properties.hibernate.format_sql=true
spring.datasource.initialization-mode=always
spring.jpa.hibernate.naming.physical-
strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
【问题讨论】:
标签: java spring hibernate spring-boot h2