Package migratedb.v1.core.internal.info
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
-
-
Field Summary
-
Fields inherited from class migratedb.v1.core.api.output.OperationResult
migratedbVersion, operation, warnings
-
-
Constructor Summary
Constructors Constructor Description MigrationInfoServiceImpl(MigrationResolver migrationResolver, SchemaHistory schemaHistory, Database database, Configuration configuration, TargetVersion target, List<MigrationPattern> cherryPick, ValidationContext validationContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MigrationInfo[]all()MigrationInfo[]applied()MigrationInfocurrent()MigrationInfo[]failed()MigrationInfo[]future()InfoResultgetInfoResult()InfoResultgetInfoResult(MigrationInfo[] infos)MigrationInfonext()MigrationInfo[]outdated()MigrationInfo[]outOfOrder()MigrationInfo[]pending()voidrefresh()Refreshes the info about migration state using the resolved migrations and schema history information.MigrationInfo[]resolved()voidsetAllSchemasEmpty(Schema[] schemas)List<ValidateOutput>validate()-
Methods inherited from class migratedb.v1.core.api.output.OperationResult
addWarning
-
-
-
-
Constructor Detail
-
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 Detail
-
refresh
public void refresh()
Refreshes the info about migration state using the resolved migrations and schema history information.
-
all
public MigrationInfo[] all()
- Specified by:
allin interfaceMigrationInfoService- Returns:
- The full set of info about applied, current and future migrations. An empty array if none.
-
current
public MigrationInfo current()
- Specified by:
currentin interfaceMigrationInfoService- Returns:
- Information about the current applied migration or
nullif no migrations have been applied yet.
-
next
public MigrationInfo next()
- Specified by:
nextin interfaceMigrationInfoService- Returns:
- The next pending migration or
nullif no migration is pending. This will be the first outdated repeatable migration if no pending versioned migration exists.
-
pending
public MigrationInfo[] pending()
- Specified by:
pendingin interfaceMigrationInfoService- 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:
appliedin interfaceMigrationInfoService- Returns:
- All applied migrations. An empty array if none.
-
resolved
public MigrationInfo[] resolved()
- Specified by:
resolvedin interfaceMigrationInfoService- Returns:
- All resolved migrations. An empty array if none.
-
failed
public MigrationInfo[] failed()
- Specified by:
failedin interfaceMigrationInfoService- Returns:
- The failed migrations. An empty array if none.
-
future
public MigrationInfo[] future()
- Specified by:
futurein interfaceMigrationInfoService- Returns:
- The future migrations. An empty array if none.
-
outOfOrder
public MigrationInfo[] outOfOrder()
- Specified by:
outOfOrderin interfaceMigrationInfoService- Returns:
- The out of order migrations. An empty array if none.
-
outdated
public MigrationInfo[] outdated()
- Specified by:
outdatedin interfaceMigrationInfoService- 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)
-
-