mongodb初始化注销

This commit is contained in:
lvleigang 2024-08-23 15:06:36 +08:00
parent 43f01064ee
commit 2eaafe65d5
3 changed files with 26 additions and 22 deletions

View File

@ -18,7 +18,7 @@ spring:
# username: hzya
flyway:
# 启动flyway migration, 默认为true
enabled: false
enabled: true
datasource:
dynamic:
druid:

View File

@ -6,6 +6,8 @@ server:
tomcat:
uri-encoding: utf-8
spring:
autoconfigure:
exclude: org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration
flyway:
# 启动flyway migration, 默认为true
enabled: true

View File

@ -48,6 +48,7 @@ public class FlywayConfig {
@PostConstruct
public void migrateOrder() {
if("false".equals(enabled)){
String pwd = AESUtil.decrypt(password);
DynamicRoutingDataSource ds = (DynamicRoutingDataSource) dataSource;
DataSource dsDatasource = null;
@ -72,5 +73,6 @@ public class FlywayConfig {
.load();
flyway.migrate();
}
}
}