DbCreateOperation createOperation = new DbCreateOperation(dbToolContext, true, null, false);
createOperation.execute();
} else if (actualSchemaVersion < expectedSchemaVersion) {
// Upgrade from expected to actual
DbUpgradeOperation upgradeOperation = new DbUpgradeOperation(dbToolContext, true, null);
upgradeOperation.execute();
} else if (expectedSchemaVersion > actualSchemaVersion) {
throw new OpenGammaRuntimeException(schemaName + " schema too new. This build of the OpenGamma Platform works with version " +
expectedSchemaVersion + " of the " + schemaName + " schema, but the database contains version " + actualSchemaVersion +
". Unable to downgrade an existing database.");
}