mongodb初始化注销
This commit is contained in:
parent
43f01064ee
commit
2eaafe65d5
|
@ -18,7 +18,7 @@ spring:
|
||||||
# username: hzya
|
# username: hzya
|
||||||
flyway:
|
flyway:
|
||||||
# 启动flyway migration, 默认为true
|
# 启动flyway migration, 默认为true
|
||||||
enabled: false
|
enabled: true
|
||||||
datasource:
|
datasource:
|
||||||
dynamic:
|
dynamic:
|
||||||
druid:
|
druid:
|
||||||
|
|
|
@ -6,6 +6,8 @@ server:
|
||||||
tomcat:
|
tomcat:
|
||||||
uri-encoding: utf-8
|
uri-encoding: utf-8
|
||||||
spring:
|
spring:
|
||||||
|
autoconfigure:
|
||||||
|
exclude: org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration
|
||||||
flyway:
|
flyway:
|
||||||
# 启动flyway migration, 默认为true
|
# 启动flyway migration, 默认为true
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
|
@ -48,6 +48,7 @@ public class FlywayConfig {
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void migrateOrder() {
|
public void migrateOrder() {
|
||||||
|
if("false".equals(enabled)){
|
||||||
String pwd = AESUtil.decrypt(password);
|
String pwd = AESUtil.decrypt(password);
|
||||||
DynamicRoutingDataSource ds = (DynamicRoutingDataSource) dataSource;
|
DynamicRoutingDataSource ds = (DynamicRoutingDataSource) dataSource;
|
||||||
DataSource dsDatasource = null;
|
DataSource dsDatasource = null;
|
||||||
|
@ -72,5 +73,6 @@ public class FlywayConfig {
|
||||||
.load();
|
.load();
|
||||||
flyway.migrate();
|
flyway.migrate();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue