【发布时间】:2021-08-07 10:28:38
【问题描述】:
当我想在 Springboot 应用程序中使用 Mysql 数据库时,我可以通过类似于以下属性的字符串在启动时创建它:
spring.datasource.jdbc-url=jdbc:mysql://localhost:3306/testDb?createDatabaseIfNotExist=true&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
不过 PostgreSQL 似乎忽略了这一点:
spring.datasource.jdbc-url=jdbc:postgresql://localhost:5432/testdb?createDatabaseIfNotExist=true&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true
有没有办法在 Flyway 尝试启动表之前在 SpringBoot 应用程序启动时创建 PostgreSQL 数据库?
【问题讨论】:
标签: postgresql spring-boot jdbc