congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Configuration
Code IndexAdd Tabnine to your IDE (free)

How to use
Configuration
in
org.flywaydb.core.api.configuration

Best Java code snippets using org.flywaydb.core.api.configuration.Configuration (Showing top 15 results out of 315)

origin: flyway/flyway-test-extensions

private String[] convertLocationToString(Flyway flyWay) {
  Location[] locations = flyWay.getConfiguration().getLocations();
  String [] stringLocations = new String[locations.length];
  for (int i = 0; i < locations.length; i++) {
    stringLocations[i] = locations[i].getDescriptor();
  }
  return stringLocations;
}
origin: com.blackducksoftware.bdio/bdio-tinkerpop

/**
 * Returns a Sqlg configuration (Apache Commons) based on the supplied Flyway configuration.
 */
protected org.apache.commons.configuration.Configuration sqlgConfiguration(Configuration configuration) {
  Map<String, Object> result = new LinkedHashMap<>();
  // The most important part is getting the JDBC URL since that is required by Sqlg
  result.put(SqlgGraph.JDBC_URL, JdbcUrlDataSource.unwrap(configuration.getDataSource()).getJdbcUrl());
  // Abuse the Flyway place holders as extra configuration parameters for Sqlg
  result.putAll(configuration.getPlaceholders());
  return new MapConfiguration(result);
}
origin: com.blackducksoftware.bdio/bdio-tinkerpop

/**
 * Return a Sqlg dialect based on the supplied Flyway configuration.
 */
protected SqlDialect sqlDialect(Configuration configuration) {
  // Mimic what Sqlg does to load a dialect
  String connectionUri = JdbcUrlDataSource.unwrap(configuration.getDataSource()).getJdbcUrl();
  for (SqlgPlugin p : ServiceLoader.load(SqlgPlugin.class, SqlgGraph.class.getClassLoader())) {
    if (p.getDriverFor(connectionUri) != null) {
      return p.instantiateDialect();
    }
  }
  throw new IllegalStateException("Unable to determine Sqlg dialect to use for JDBC URL: " + connectionUri);
}
origin: dropwizard/dropwizard-flyway

  @Override
  protected void run(final Namespace namespace, final Flyway flyway) throws Exception {
    final Boolean namespaceBoolean = namespace.getBoolean(OUT_OF_ORDER);
    final Boolean cleanOnValidationError = namespace.getBoolean(CLEAN_ON_VALIDATION_ERROR);

    FluentConfiguration config = Flyway.configure(flyway.getConfiguration().getClassLoader()).configuration(flyway.getConfiguration());
    
    if (namespaceBoolean != null) {
      config.outOfOrder(namespaceBoolean);
    }

    if (cleanOnValidationError != null) {
      config.cleanOnValidationError(cleanOnValidationError);
    }

    Flyway customFlyway = config.load();
    
    customFlyway.validate();
  }
}
origin: theotherp/nzbhydra2

  @Override
  public void migrate(Flyway flyway) {
    try {
      flyway.migrate();
    } catch (FlywayException e) {
      if (e.getMessage().contains("1.15")) {
        logger.info("Found failed database migration. Attempting repair");
        flyway.repair();
        try {
          flyway.getConfiguration().getDataSource().getConnection().createStatement().executeUpdate("delete from PUBLIC.\"schema_version\" where \"version\" = '1.15' or \"version\" = '1.16'");
        } catch (SQLException e1) {
          logger.error("Error while deleting old migration steps", e);
        }
        flyway.migrate();
      } else {
        logger.error("Unable to migrate", e);
        throw e;
      }
    }
  }
};
origin: dropwizard/dropwizard-flyway

final Boolean baselineOnMigrate = namespace.getBoolean(INIT_ON_MIGRATE);
FluentConfiguration config = Flyway.configure(flyway.getConfiguration().getClassLoader()).configuration(flyway.getConfiguration());
origin: flyway/flyway-test-extensions

private String[] convertLocationToString(Flyway flyWay) {
  Location[] locations = flyWay.getConfiguration().getLocations();
  String [] stringLocations = new String[locations.length];
  for (int i = 0; i < locations.length; i++) {
    stringLocations[i] = locations[i].getDescriptor();
  }
  return stringLocations;
}
origin: org.flywaydb/flyway-gradle-plugin

@SuppressWarnings("unused")
@TaskAction
public Object runTask() {
  try {
    Map<String, String> envVars = ConfigUtils.environmentVariablesToPropertyMap();
    Set<URL> extraURLs = new HashSet<>();
    if (isJavaProject()) {
      addClassesAndResourcesDirs(extraURLs);
      addConfigurationArtifacts(determineConfigurations(envVars), extraURLs);
    }
    ClassLoader classLoader = new URLClassLoader(
        extraURLs.toArray(new URL[0]),
        getProject().getBuildscript().getClassLoader());
    Flyway flyway = Flyway.configure(classLoader).configuration(createFlywayConfig(envVars)).load();
    Object result = run(flyway);
    ((DriverDataSource) flyway.getConfiguration().getDataSource()).shutdownDatabase();
    return result;
  } catch (Exception e) {
    throw new FlywayException(collectMessages(e, "Error occurred while executing " + getName()), e);
  }
}
origin: org.flywaydb.flyway-test-extensions/flyway-spring5-test

private String[] convertLocationToString(Flyway flyWay) {
  Location[] locations = flyWay.getConfiguration().getLocations();
  String [] stringLocations = new String[locations.length];
  for (int i = 0; i < locations.length; i++) {
    stringLocations[i] = locations[i].getDescriptor();
  }
  return stringLocations;
}
origin: flyway/flyway-test-extensions

private String[] convertLocationToString(Flyway flyWay) {
  Location[] locations = flyWay.getConfiguration().getLocations();
  String [] stringLocations = new String[locations.length];
  for (int i = 0; i < locations.length; i++) {
    stringLocations[i] = locations[i].getDescriptor();
  }
  return stringLocations;
}
origin: org.flywaydb.flyway-test-extensions/flyway-spring-test

private String[] convertLocationToString(Flyway flyWay) {
  Location[] locations = flyWay.getConfiguration().getLocations();
  String [] stringLocations = new String[locations.length];
  for (int i = 0; i < locations.length; i++) {
    stringLocations[i] = locations[i].getDescriptor();
  }
  return stringLocations;
}
origin: org.flywaydb.flyway-test-extensions/flyway-spring3-test

private String[] convertLocationToString(Flyway flyWay) {
  Location[] locations = flyWay.getConfiguration().getLocations();
  String [] stringLocations = new String[locations.length];
  for (int i = 0; i < locations.length; i++) {
    stringLocations[i] = locations[i].getDescriptor();
  }
  return stringLocations;
}
origin: org.flywaydb.flyway-test-extensions/flyway-spring4-test

private String[] convertLocationToString(Flyway flyWay) {
  Location[] locations = flyWay.getConfiguration().getLocations();
  String [] stringLocations = new String[locations.length];
  for (int i = 0; i < locations.length; i++) {
    stringLocations[i] = locations[i].getDescriptor();
  }
  return stringLocations;
}
origin: kawasima/enkan

private boolean isMigrationAvailable() {
  return Arrays.stream(flyway.getConfiguration().getLocations())
      .anyMatch(l-> {
        if (l.isClassPath()) {
          return Thread.currentThread().getContextClassLoader().getResource(l.getPath()) != null;
        } else if (l.isFileSystem()){
          return Files.exists(Paths.get(l.getPath()));
        } else throw new UnreachableException();
      });
}
origin: flyway/flyway-test-extensions

private String[] convertLocationToString(Flyway flyWay) {
  Location[] locations = flyWay.getConfiguration().getLocations();
  String [] stringLocations = new String[locations.length];
  for (int i = 0; i < locations.length; i++) {
    stringLocations[i] = locations[i].getDescriptor();
  }
  return stringLocations;
}
org.flywaydb.core.api.configurationConfiguration

Most used methods

  • getLocations
  • getDataSource
  • getClassLoader
  • getPlaceholders

Popular in Java

  • Start an intent from android
  • findViewById (Activity)
  • setScale (BigDecimal)
  • getApplicationContext (Context)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • ImageIO (javax.imageio)
  • JOptionPane (javax.swing)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now