Class MigrationInfoServiceImpl

java.lang.Object
migratedb.v1.core.api.output.OperationResult
migratedb.v1.core.internal.info.MigrationInfoServiceImpl
All Implemented Interfaces:
MigrationInfoService

public class MigrationInfoServiceImpl extends OperationResult implements MigrationInfoService
  • Constructor Details

    • MigrationInfoServiceImpl

      public MigrationInfoServiceImpl(MigrationResolver migrationResolver, SchemaHistory schemaHistory, Database<?> database, Configuration configuration, TargetVersion target, List<MigrationPattern> cherryPick, ValidationContext validationContext)
      Parameters:
      migrationResolver - The migration resolver for available migrations.
      schemaHistory - The schema history table for applied migrations.
      configuration - The current configuration.
      target - The target version up to which to retrieve the info.
      cherryPick - The migrations to consider when migration.
  • Method Details

    • refresh

      public void refresh()
      Refreshes the info about migration state using the resolved migrations and schema history information.
    • all

      public MigrationInfo[] all()
      Specified by:
      all in interface MigrationInfoService
      Returns:
      The full set of info about applied, current and future migrations. An empty array if none.
    • current

      public MigrationInfo current()
      Specified by:
      current in interface MigrationInfoService
      Returns:
      Information about the current applied migration or null if no migrations have been applied yet.
    • next

      public MigrationInfo next()
      Specified by:
      next in interface MigrationInfoService
      Returns:
      The next pending migration or null if no migration is pending. This will be the first outdated repeatable migration if no pending versioned migration exists.
    • pending

      public MigrationInfo[] pending()
      Specified by:
      pending in interface MigrationInfoService
      Returns:
      All pending migrations, available locally, but not yet applied to the DB, ordered by version. An empty array if none.
    • applied

      public MigrationInfo[] applied()
      Specified by:
      applied in interface MigrationInfoService
      Returns:
      All applied migrations. An empty array if none.
    • resolved

      public MigrationInfo[] resolved()
      Specified by:
      resolved in interface MigrationInfoService
      Returns:
      All resolved migrations. An empty array if none.
    • failed

      public MigrationInfo[] failed()
      Specified by:
      failed in interface MigrationInfoService
      Returns:
      The failed migrations. An empty array if none.
    • future

      public MigrationInfo[] future()
      Specified by:
      future in interface MigrationInfoService
      Returns:
      The future migrations. An empty array if none.
    • outOfOrder

      public MigrationInfo[] outOfOrder()
      Specified by:
      outOfOrder in interface MigrationInfoService
      Returns:
      The out of order migrations. An empty array if none.
    • outdated

      public MigrationInfo[] outdated()
      Specified by:
      outdated in interface MigrationInfoService
      Returns:
      All outdated repeatable migrations. An empty array if none.
    • validate

      public List<ValidateOutput> validate()
      Returns:
      The list of migrations that failed validation, which is empty if everything is fine.
    • setAllSchemasEmpty

      public void setAllSchemasEmpty(Schema<?,?>[] schemas)
    • getInfoResult

      public InfoResult getInfoResult()
    • getInfoResult

      public InfoResult getInfoResult(MigrationInfo[] infos)