Package com.opengamma.util.db.tool

Examples of com.opengamma.util.db.tool.DbUpgradeOperation.execute()


  //-------------------------------------------------------------------------
  @Override
  protected void doRun(boolean write, File outputFile) throws Exception {
    DbUpgradeOperation upgradeOp = new DbUpgradeOperation(getDbToolContext(), write, outputFile);
    upgradeOp.execute();
    if (!upgradeOp.isUpgradeRequired()) {
      System.out.println("Database up-to-date");
    }
  }
 
View Full Code Here


      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.");
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.