當前位置: 首頁>>代碼示例>>Java>>正文


Java Flyway.info方法代碼示例

本文整理匯總了Java中org.flywaydb.core.Flyway.info方法的典型用法代碼示例。如果您正苦於以下問題:Java Flyway.info方法的具體用法?Java Flyway.info怎麽用?Java Flyway.info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.flywaydb.core.Flyway的用法示例。


在下文中一共展示了Flyway.info方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: run

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
@Override protected void run(Bootstrap<KeywhizConfig> bootstrap, Namespace namespace,
    KeywhizConfig config) throws Exception {
  DataSource dataSource = config.getDataSourceFactory()
      .build(new MetricRegistry(), "migration-preview-datasource");

  Flyway flyway = new Flyway();
  flyway.setDataSource(dataSource);
  flyway.setLocations(config.getMigrationsDir());
  MigrationInfoService info = flyway.info();

  MigrationInfo current = info.current();
  if (current == null) {
    logger.info("No migrations have been run yet.");
  } else {
    logger.info("Currently applied migration:");
    logger.info("* {} - {}", current.getVersion(), current.getDescription());
  }

  if (info.pending().length > 0) {
    logger.info("Pending migrations:");
    for (MigrationInfo migration : info.pending()) {
      logger.info("* {} - {}", migration.getVersion(), migration.getDescription());
    }
  } else {
    logger.info("No pending migrations");
  }
}
 
開發者ID:square,項目名稱:keywhiz,代碼行數:28,代碼來源:PreviewMigrateCommand.java

示例2: getDatabaseVersion

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
private static MigrationVersion getDatabaseVersion(DataSource dataSource) throws FlywayException {
  Flyway flyway = new Flyway();
  flyway.setDataSource(dataSource);
  MigrationInfoService info = flyway.info();
  MigrationVersion currentVersion = MigrationVersion.EMPTY;
  if (info.current() != null) {
    currentVersion = info.current().getVersion();
  }
  return currentVersion;
}
 
開發者ID:apache,項目名稱:incubator-gobblin,代碼行數:11,代碼來源:DatabaseJobHistoryStore.java

示例3: run

import org.flywaydb.core.Flyway; //導入方法依賴的package包/類
@Override
public void run(final Flyway flyway) {
  flyway.info();
}
 
開發者ID:jooby-project,項目名稱:jooby,代碼行數:5,代碼來源:Flywaydb.java


注:本文中的org.flywaydb.core.Flyway.info方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。