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
-
Field Summary
Fields inherited from class migratedb.v1.core.api.output.OperationResult
migratedbVersion, operation, warnings -
Constructor Summary
ConstructorsConstructorDescriptionMigrationInfoServiceImpl(MigrationResolver migrationResolver, SchemaHistory schemaHistory, Database<?> database, Configuration configuration, TargetVersion target, List<MigrationPattern> cherryPick, ValidationContext validationContext) -
Method Summary
Modifier and TypeMethodDescriptionall()applied()current()failed()future()getInfoResult(MigrationInfo[] infos) next()outdated()pending()voidrefresh()Refreshes the info about migration state using the resolved migrations and schema history information.resolved()voidsetAllSchemasEmpty(Schema<?, ?>[] schemas) validate()Methods inherited from class migratedb.v1.core.api.output.OperationResult
addWarning
-
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
- Specified by:
allin interfaceMigrationInfoService- Returns:
- The full set of info about applied, current and future migrations. An empty array if none.
-
current
- Specified by:
currentin interfaceMigrationInfoService- Returns:
- Information about the current applied migration or
nullif no migrations have been applied yet.
-
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
- 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
- Specified by:
appliedin interfaceMigrationInfoService- Returns:
- All applied migrations. An empty array if none.
-
resolved
- Specified by:
resolvedin interfaceMigrationInfoService- Returns:
- All resolved migrations. An empty array if none.
-
failed
- Specified by:
failedin interfaceMigrationInfoService- Returns:
- The failed migrations. An empty array if none.
-
future
- Specified by:
futurein interfaceMigrationInfoService- Returns:
- The future migrations. An empty array if none.
-
outOfOrder
- Specified by:
outOfOrderin interfaceMigrationInfoService- Returns:
- The out of order migrations. An empty array if none.
-
outdated
- Specified by:
outdatedin interfaceMigrationInfoService- Returns:
- All outdated repeatable migrations. An empty array if none.
-
validate
- Returns:
- The list of migrations that failed validation, which is empty if everything is fine.
-
setAllSchemasEmpty
-
getInfoResult
-
getInfoResult
-