io.dropwizard.flyway.cli.DbInfoCommand 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.cli;
import io.dropwizard.flyway.FlywayConfiguration;
import io.dropwizard.Configuration;
import io.dropwizard.db.DatabaseConfiguration;
import net.sourceforge.argparse4j.inf.Namespace;
import org.flywaydb.core.Flyway;
import static org.flywaydb.core.internal.info.MigrationInfoDumper.dumpToAsciiTable;
public class DbInfoCommand extends AbstractFlywayCommand {
public DbInfoCommand(final DatabaseConfiguration databaseConfiguration,
final FlywayConfiguration flywayConfiguration,
final Class configurationClass) {
super("info", "Prints the details and status information about all the migrations.",
databaseConfiguration, flywayConfiguration, configurationClass);
}
@Override
public void run(final Namespace namespace, final Flyway flyway) throws Exception {
System.out.println(dumpToAsciiTable(flyway.info().all()));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy