当前位置: 首页>>代码示例>>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;未经允许,请勿转载。