【发布时间】:2021-03-13 18:17:19
【问题描述】:
当我使用 Spring Boot 1.5 时,在应用程序启动时,当设置了适当的配置时,Hibernate 会执行位于 /resources 文件夹中的 schema.sql 文件。在 Spring Boot 2.0 发布后,此功能不再起作用。我在文档中找不到有关此更改的任何信息。 这是我的 application.properties 文件内容:
spring.datasource.url=...
spring.datasource.username=...
spring.datasource.password=...
#spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.hibernate.ddl-auto=none
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
Spring Boot 2.0 是否有一些变化或者这是一个错误/问题?
【问题讨论】:
-
我有同样的问题,下面没有答案解决它。有什么想法吗?
-
没有一个答案对我有帮助:(将 spring boot 升级到 2.x 后,db 停止自动更新/创建新表
标签: java spring hibernate spring-boot