use of org.flywaydb.core.internal.command.DbValidate in project flyway by flyway.
the class Flyway method doValidate.
/**
* Performs the actual validation. All set up must have taken place beforehand.
*
* @param connectionMetaDataTable The database connection for the metadata table.
* @param dbSupport The database-specific support.
* @param migrationResolver The migration resolver;
* @param metaDataTable The metadata table.
* @param schemas The schemas managed by Flyway.
* @param pending Whether pending migrations are ok.
*/
private void doValidate(Connection connectionMetaDataTable, DbSupport dbSupport, MigrationResolver migrationResolver, MetaDataTable metaDataTable, Schema[] schemas, FlywayCallback[] flywayCallbacks, boolean pending) {
String validationError = new DbValidate(connectionMetaDataTable, dbSupport, metaDataTable, schemas[0], migrationResolver, target, outOfOrder, pending, ignoreMissingMigrations, ignoreFutureMigrations, flywayCallbacks).validate();
if (validationError != null) {
if (cleanOnValidationError) {
new DbClean(connectionMetaDataTable, dbSupport, metaDataTable, schemas, flywayCallbacks, cleanDisabled).clean();
metaDataTable.clearCache();
} else {
throw new FlywayException("Validate failed: " + validationError);
}
}
}
Aggregations