use of liquibase.exception.CustomPreconditionErrorException in project libresonic by Libresonic.
the class DbmsVersionPrecondition method check.
@Override
public void check(Database database) throws CustomPreconditionFailedException, CustomPreconditionErrorException {
try {
int dbMajor = database.getDatabaseMajorVersion();
int dbMinor = database.getDatabaseMinorVersion();
if (major != null && !major.equals(dbMajor)) {
throw new CustomPreconditionFailedException("DBMS Major Version Precondition failed: expected " + major + ", got " + dbMajor);
}
if (minor != null && !minor.equals(dbMinor)) {
throw new CustomPreconditionFailedException("DBMS Minor Version Precondition failed: expected " + minor + ", got " + dbMinor);
}
} catch (DatabaseException e) {
throw new CustomPreconditionErrorException(e.getMessage());
}
}
Aggregations