优化数据库表结构升级日志提示

This commit is contained in:
heavyrain2012
2021-09-29 19:50:20 +08:00
parent 6d021568d3
commit 4bcf784a6d
@@ -107,8 +107,12 @@ public class DBUtil {
} }
Flyway flyway = Flyway.configure().dataSource(comboPooledDataSource).locations(migrateLocation).baselineOnMigrate(true).load(); Flyway flyway = Flyway.configure().dataSource(comboPooledDataSource).locations(migrateLocation).baselineOnMigrate(true).load();
if(!IsEmbedDB && (flyway.info().current() == null || flyway.info().current().getVersion().getMajor().intValue() < 43)) { if(!IsEmbedDB) {
System.out.println("数据库执行初始化或升级需要较长时间,可能长达数分钟或更长,请耐心等待,不要中断。。。"); if(flyway.info().current() == null) {
System.out.println("数据库执行初始化需要较长时间,可能长达数分钟或更长,请耐心等待,不要中断。。。");
} else if(flyway.info().current().getVersion().getMajor().intValue() < 43) {
System.out.println("数据库执行升级需要较长时间,可能长达数分钟或更长,请耐心等待,不要中断。。。");
}
} }
flyway.migrate(); flyway.migrate();