Skip to content

Commit

Permalink
fix #436; always save "migration completed" marker with updating DB v…
Browse files Browse the repository at this point in the history
…ersion
  • Loading branch information
gfx committed Oct 29, 2018
1 parent 0e2506f commit f81d4e9
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public class ManualStepMigration extends AbstractMigrationEngine {

public static final String MIGRATION_STEPS_TABLE = "orma_migration_steps";

@Nullable
public static final String MIGRATION_COMPLETED = null;

static final String kId = "id";

static final String kVersion = "version";
Expand Down Expand Up @@ -177,7 +180,7 @@ public void run() {

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

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

saveStep(db, version, MIGRATION_COMPLETED);
}

public void saveStep(@NonNull Database db, int version, @Nullable String sql) {
Expand Down

0 comments on commit f81d4e9

Please sign in to comment.