Find update steps and execute them with bootstrap context

This commit is contained in:
René Pfeuffer
2019-05-14 14:12:08 +02:00
parent bcd249a332
commit 46b1bb8869
5 changed files with 109 additions and 89 deletions

View File

@@ -0,0 +1,20 @@
package sonia.scm;
import sonia.scm.migration.UpdateStep;
import javax.inject.Inject;
import java.util.Set;
public class MigrationEngine {
private final Set<UpdateStep> steps;
@Inject
public MigrationEngine(Set<UpdateStep> steps) {
this.steps = steps;
}
public void migrate() {
steps.forEach(UpdateStep::doUpdate);
}
}