Skip to content

Commit

Permalink
优化数据库表结构升级日志提示
Browse files Browse the repository at this point in the history
  • Loading branch information
heavyrain2012 committed Sep 29, 2021
1 parent 6d02156 commit 4bcf784
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions broker/src/main/java/win/liyufan/im/DBUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,12 @@ public static void init(IConfig config) {
}

Flyway flyway = Flyway.configure().dataSource(comboPooledDataSource).locations(migrateLocation).baselineOnMigrate(true).load();
if(!IsEmbedDB && (flyway.info().current() == null || flyway.info().current().getVersion().getMajor().intValue() < 43)) {
System.out.println("数据库执行初始化或升级需要较长时间,可能长达数分钟或更长,请耐心等待,不要中断。。。");
if(!IsEmbedDB) {
if(flyway.info().current() == null) {
System.out.println("数据库执行初始化需要较长时间,可能长达数分钟或更长,请耐心等待,不要中断。。。");
} else if(flyway.info().current().getVersion().getMajor().intValue() < 43) {
System.out.println("数据库执行升级需要较长时间,可能长达数分钟或更长,请耐心等待,不要中断。。。");
}
}
flyway.migrate();

Expand Down

0 comments on commit 4bcf784

Please sign in to comment.