Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gfx committed Oct 29, 2018
1 parent f81d4e9 commit fa84fa1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ public void run() {
}
}
runTasksInTransaction(db, tasks);
saveStep(db, newVersion, MIGRATION_COMPLETED);
}

public void downgrade(@NonNull Database db, int oldVersion, int newVersion) {
Expand All @@ -176,11 +177,11 @@ public void run() {
}
}
runTasksInTransaction(db, tasks);
saveStep(db, newVersion, MIGRATION_COMPLETED);
}

private void runTasksInTransaction(@NonNull Database db, @NonNull final List<Runnable> tasks) {
if (tasks.isEmpty()) {
saveStep(db, version, MIGRATION_COMPLETED);
return;
}

Expand All @@ -192,8 +193,6 @@ public void run() {
}
}
});

saveStep(db, version, MIGRATION_COMPLETED);
}

public void saveStep(@NonNull Database db, int version, @Nullable String sql) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void testIdempotenceWithNop() throws Exception {
public void upgradeFull() throws Exception {
migration.upgrade(db, 1, 100);

assertThat(migration.fetchDbVersion(db), is(16));
assertThat(migration.fetchDbVersion(db), is(100));

assertThat(seq.size(), is(4));

Expand Down

0 comments on commit fa84fa1

Please sign in to comment.