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; }
@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(); } }
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; }
@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; } }
public FlywayFactory getFlywayFactory() { return flywayFactory; }
@Override public FlywayFactory getFlywayFactory(BiblioConfiguration configuration) { return configuration.getFlywayFactory(); }
public FlywayFactory getFlywayFactory() { return _flywayFactory; }
public FlywayFactory flyway() { return flyway; }