Java 类io.dropwizard.flyway.FlywayFactory 实例源码

项目:openregister-java    文件:RegisterContextFactory.java   
private FlywayFactory getFlywayFactory(RegisterName registerName, Optional<String> custodianName, RegisterConfigConfiguration registerConfigConfiguration) {
    FlywayFactory flywayFactory = new FlywayFactory();
    flywayFactory.setLocations(Arrays.asList("/sql", "uk.gov.migration"));
    flywayFactory.setPlaceholders(ImmutableMap.of("registerName", registerName.value(), "custodianName", custodianName.orElse(""), "fieldsYamlUrl",registerConfigConfiguration.getFieldsYamlLocation(),
            "registersYamlUrl", registerConfigConfiguration.getRegistersYamlLocation()));
    flywayFactory.setOutOfOrder(true);
    return flywayFactory;
}
项目:openregister-java    文件:MigrateDatabaseRule.java   
@Override
protected void before() {
    for (TestRegister register : registers) {
        FlywayFactory flywayFactory = getFlywayFactory(register.name());
        Flyway flyway = flywayFactory.build(getDataSource(register.getDatabaseConnectionString("MigrateDatabaseRule")));
        flyway.setSchemas(register.getSchema());
        flyway.migrate();
    }
}
项目:openregister-java    文件:MigrateDatabaseRule.java   
private FlywayFactory getFlywayFactory(String registerName) {
    FlywayFactory flywayFactory = new FlywayFactory();
    flywayFactory.setLocations(Collections.singletonList("/sql"));
    flywayFactory.setPlaceholders(Collections.singletonMap("registerName", registerName));
    flywayFactory.setOutOfOrder(true);
    return flywayFactory;
}
项目:dropwizard-flyway    文件:AbstractFlywayCommand.java   
@Override
protected void run(final Bootstrap<T> bootstrap, final Namespace namespace, final T configuration) throws Exception {
    final PooledDataSourceFactory datasourceFactory = databaseConfiguration.getDataSourceFactory(configuration);
    final FlywayFactory flywayFactory = flywayConfiguration.getFlywayFactory(configuration);
    final Flyway flyway = flywayFactory.build(datasourceFactory.build(bootstrap.getMetricRegistry(), "Flyway"));

    try {
        run(namespace, flyway);
    } catch (FlywayException e) {
        LOG.error("Error while running database command", e);
        throw e;
    }
}
项目:service-epitope    文件:EpitopeServiceConfiguration.java   
public FlywayFactory getFlywayFactory() {
    return flywayFactory;
}
项目:biblio-server    文件:BiblioApplication.java   
@Override
public FlywayFactory getFlywayFactory(BiblioConfiguration configuration) {
    return configuration.getFlywayFactory();
}
项目:biblio-server    文件:BiblioConfiguration.java   
public FlywayFactory getFlywayFactory() {
    return _flywayFactory;
}
项目:droptools    文件:ExampleConfig.java   
public FlywayFactory flyway() {
    return flyway;
}