hibernate - Spring Boot 2.1 - 不能使用 hbm2ddl.auto 创建表
问题描述
我正在使用 Spring Boot 2.1.1 开始一个项目,我通常使用这个 application.properties 来创建或更新数据库表。我正在使用 MySQL 数据库
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
spring.datasource.driverClassName=com.mysql.jdbc.Driver
spring.datasource.initialization-mode=always
spring.jpa.hibernate.ddl-auto=update
有了这个属性,我可以用 Spring boot 1.5 更新模式,现在应用程序启动但没有更新。
我补充说,至于迁移指南,the spring.datasource.initialization-mode=always
道具,但没有任何改变......
如果我选择create
or create-drop
,我会看到 Spring 尝试运行模式文件...所以问题出在update
解决方案
推荐阅读
- python - 在带有 random.sample 的 for 循环中没有重复
- mysql - MySQL 事件不起作用(插入语句)
- android - 如何在android导航中使用单顶
- c# - 将枚举从字符串转换为数据库中的 Int 然后返回字符串 - Entity Framework Core 3
- c# - 椭圆纹理没有做预期的事情
- postgresql - 使用 prisma 在本地连接 postgres 数据库
- google-pagespeed - “来自引用者 https://www.googleapis.com/ 的请求被阻止”错误
- django - django:Reverse for 'detail' 没有找不到参数。尝试了 1 种模式:['detail/(?P
[0-9]+)/$'] - f# - FSharp 计算表达式:无法在自定义操作中引用绑定值
- python - Python重新搜索二进制字符串