Skip to content

Commit 737102c

Browse files
committed
Made the Migrator add methods return this to allow joining calls.
1 parent 92fa49f commit 737102c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/org/javawebstack/orm/migration/Migrator.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,19 @@ public Migrator(SQL sql, ORMConfig config){
2525
} catch (ORMConfigurationException ignored) {}
2626
}
2727

28-
public void add(Migration... migrations){
28+
public Migrator add(Migration... migrations){
2929
this.migrations.addAll(Arrays.asList(migrations));
30+
return this;
3031
}
3132

32-
public void add(Package p){
33+
public Migrator add(Package p){
3334
Reflections reflections = new Reflections(p.getName());
3435
reflections.getSubTypesOf(Migration.class).forEach(c -> {
3536
try {
3637
add(c.newInstance());
3738
} catch (InstantiationException | IllegalAccessException e) {}
3839
});
40+
return this;
3941
}
4042

4143
public void migrate(){

0 commit comments

Comments
 (0)