io.dropwizard.flyway.FlywayBundle Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dropwizard-flyway Show documentation
Show all versions of dropwizard-flyway Show documentation
Addon bundle for Dropwizard to support Flyway for database migrations
package io.dropwizard.flyway;
import io.dropwizard.flyway.cli.DbCommand;
import io.dropwizard.Bundle;
import io.dropwizard.Configuration;
import io.dropwizard.db.DatabaseConfiguration;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import io.dropwizard.util.Generics;
public abstract class FlywayBundle
implements Bundle, DatabaseConfiguration, FlywayConfiguration {
@Override
public final void initialize(final Bootstrap> bootstrap) {
final Class klass = Generics.getTypeParameter(getClass(), Configuration.class);
bootstrap.addCommand(new DbCommand(this, this, klass));
}
@Override
public final void run(final Environment environment) {
// nothing doing
}
@Override
public FlywayFactory getFlywayFactory(T configuration) {
// Default Flyway configuration
return new FlywayFactory();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy