Java 类io.dropwizard.migrations.CloseableLiquibaseWithClassPathMigrationsFile 实例源码

项目:oacc-example-securetodo    文件:SecureTodoApplication.java   
@Override
public void run(T configuration, Environment environment) throws Exception {
   CloseableLiquibase liquibase
         = new CloseableLiquibaseWithClassPathMigrationsFile(getDataSourceFactory(configuration)
                                                                   .build(environment.metrics(), name()),
                                                             getMigrationsFileName());
   liquibase.update("");
}
项目:budgetapp    文件:MigrationManaged.java   
@Override
public void start() throws Exception {
    LOGGER.info("begin migration");
    final ManagedDataSource dataSource = dataSourceFactory.build(new MetricRegistry(), "liquibase");
    try(CloseableLiquibase liquibase = new CloseableLiquibaseWithClassPathMigrationsFile(dataSource, "migrations.xml")) {
        liquibase.update("migrations");
    }
    LOGGER.info("finish migration");
}
项目:breakerbox    文件:JdbiStore.java   
@Override
public boolean initialize() {
    try (CloseableLiquibase liquibase = new CloseableLiquibaseWithClassPathMigrationsFile(configuration
            .getDataSourceFactory()
            .build(metricRegistry, "liquibase"), MIGRATIONS_FILENAME)) {
        liquibase.update("");
        return true;
    } catch (Exception err) {
        LOGGER.error("Failed to create liquibase", err);
        throw new IllegalStateException(err);
    }
}
项目:breakerbox    文件:H2Test.java   
@Before
public void setupH2Test() throws Exception {
    liquibase = new CloseableLiquibaseWithClassPathMigrationsFile(hsqlConfig
            .getDataSourceFactory()
            .build(new MetricRegistry(), "liquibase"), JdbiStore.MIGRATIONS_FILENAME);
    liquibase.update("");
    database = new DBIFactory().build(environment(), hsqlConfig.getDataSourceFactory(), "h2test");
    database.registerArgumentFactory(new DependencyIdArgumentFactory());
    database.registerArgumentFactory(new ServiceIdArgumentFactory());
    database.registerArgumentFactory(new TenacityConfigurationArgumentFactory(Jackson.newObjectMapper()));
    database.registerArgumentFactory(new DateTimeArgumentFactory());
}