codahale/dropwizard — pull request #329 by lorrin (2013-05-13 23:46:19+00:00)
Title: multi-db liquibase migrations

I'm working on a project that has Dropwizard talking to multiple databases. This didn't require any extra trickery on the jdbi side of things, but the migrations bundle needed some adjustments to allow migration of both databases.

When you add the migrations bundle, you provide it with one configuration strategy per database:
```
public void initialize(Bootstrap bootstrap)
{
bootstrap.addBundle(new MultiDbMigrationsBundle(
ConfigurationStrategies.newMultiDbConfigurationStrategy(
ImmutableMap.> builder()
.put("this_db", new ConfigurationStrategy() {
@Override
public DatabaseConfiguration getDatabaseConfiguration (MyConfiguration configuration) {
return configuration.getThisConfiguration().getDatabaseConfiguration();
}
})
.put("that_db", new ConfigurationStrategy() {
@Override
public DatabaseConfiguration getDatabaseConfiguration (MyConfiguration configuration) {
return configuration.getThatConfiguration().getDatabaseConfiguration();
}
})
.build()
)
){});
```
The database configuration bean / YAML has been extended to allow configuration a schema resource path other then the default "`migrations.xml`".

The command line then looks like e.g.
```
db status --db that_db local.yml
```