Class MigrationRunner

java.lang.Object
com.onec.migration.MigrationRunner

public class MigrationRunner extends Object
Executes AppMigrations exactly once per database, in version order. Each migration is claimed by inserting its version into onec_schema_history inside the same transaction that runs the migration: a unique constraint arbitrates between concurrently starting instances, and a failure rolls the claim back with the work.
  • Constructor Details

  • Method Details

    • run

      public List<String> run(org.jdbi.v3.core.Jdbi jdbi, List<AppMigration> migrations)
      Runs all unapplied migrations; returns the versions executed by this call.
    • pending

      public List<AppMigration> pending(org.jdbi.v3.core.Jdbi jdbi, List<AppMigration> migrations)
      Migrations not yet recorded in the history table, in execution order.