Skip to content

Commit

Permalink
Upgrading to the latest BQModuleProvider format
Browse files Browse the repository at this point in the history
  • Loading branch information
andrus committed Nov 24, 2023
1 parent 2b34bee commit c21a6ce
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 deletions src/main/java/io/bootique/liquibase/LiquibaseModuleProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,22 @@

package io.bootique.liquibase;

import io.bootique.BQModuleMetadata;
import io.bootique.BQModuleProvider;
import io.bootique.di.BQModule;
import io.bootique.bootstrap.BuiltModule;
import io.bootique.jdbc.JdbcModuleProvider;

import java.lang.reflect.Type;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;

public class LiquibaseModuleProvider implements BQModuleProvider {

@Override
public BQModule module() {
return new LiquibaseModule();
}

@Override
public Map<String, Type> configs() {
// TODO: config prefix is hardcoded. Refactor away from ConfigModule, and make provider
// generate config prefix, reusing it in metadata...
return Collections.singletonMap("liquibase", LiquibaseRunnerFactory.class);
}

@Override
public BQModuleMetadata.Builder moduleBuilder() {
return BQModuleProvider.super
.moduleBuilder()
.description("Provides integration with Liquibase SQL migrations framework.");
public BuiltModule buildModule() {
return BuiltModule.of(new LiquibaseModule())
.provider(this)
.description("Integrates Liquibase database migrations library")
.config("liquibase", LiquibaseRunnerFactory.class)
.build();
}

@Override
Expand Down

0 comments on commit c21a6ce

Please sign in to comment.