【发布时间】:2022-01-08 14:49:04
【问题描述】:
我想使用两个数据库架构:一个带有静态数据(无法更改),另一个带有动态数据(其中在 Spring 应用程序的执行过程中会不断变化)。
在application.properties我已经规定了以下内容:
spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/XXXXXX
spring.datasource.username=root
spring.datasource.password=root
spring.second-datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/YYYYYY
spring.second-datasource.username=root
spring.second-datasource.password=root
但是我现在应该如何处理spring.jpa.hibernate.ddl-auto 参数?
对于我要安装的一个方案:
spring.jpa.hibernate.ddl-auto=create
对于其他(数据始终是静态的):
spring.jpa.hibernate.ddl-auto=update
或
spring.jpa.hibernate.ddl-auto=none
【问题讨论】:
标签: java mysql spring hibernate jpa