Merge pull request #7651 from testnet0/master

修复flyway自动升级失败
dev
JEECG 3 months ago committed by GitHub
commit e9326cab8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -11,6 +11,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import javax.annotation.PostConstruct;
import javax.sql.DataSource;
import java.util.Map;
@ -35,7 +36,7 @@ public class FlywayConfig {
*/
@Value("${spring.flyway.enabled:false}")
private Boolean enabled;
/**
* UTF-8
*/
@ -95,13 +96,13 @@ public class FlywayConfig {
*/
@Value("${spring.flyway.clean-disabled:true}")
private Boolean cleanDisabled;
@Bean
@PostConstruct
public void migrate() {
if(!enabled){
return;
}
DynamicRoutingDataSource ds = (DynamicRoutingDataSource) dataSource;
Map<String, DataSource> dataSources = ds.getDataSources();
dataSources.forEach((k, v) -> {

Loading…
Cancel
Save