Package net.raymanoz.domain

Examples of net.raymanoz.domain.SchemaVersion


 
  public String summary(){
    StringBuilder builder = new StringBuilder();
    LOG.info(configuration.getMigrationMessage());

    SchemaVersion ver = version();
    logAndAppend(builder, STARTUP_STATUS_MESSAGE_FMT, ver.getDBVersion(), ver.getPatchNo());
    scriptsToBeApplied = 0;
    long totalScripts = 0;
    for (ScriptList scriptlist: scripts()){
      totalScripts += scriptlist.size();
      long thisToApplied = helper.scriptsToBeApplied(ver, scriptlist);
View Full Code Here


 
  boolean migrate(Script script){
    if (alreadyMigrated(script)) return true;
    final long thisPatchNo = script.getPatch();
    final long thisDBver = script.getDBVersion();
    SchemaVersion version = version();
    repository.validateNoOtherActivity(thisDBver, thisPatchNo);
    scriptIdx++;
    logAndSendStatus(ScriptStatus.STARTED, script);
    repository.recordStartPatch(script);
    ScriptStatus status = script.execute(interactionStrategy);
    repository.recordFinishPatch(script, status);
   
    logAndSendStatus(status, script);
    version.setDBVersion(thisDBver);
    version.setPatchNo(thisPatchNo);
    switch (status){
      case COMPLETED:
        scriptsApplied++;
        return true;
      case SKIPPED:
View Full Code Here

    boolean allMigrated = false;
    scriptIdx = 0;
    scriptsApplied = 0;
    scriptsSkipped = 0;
    final StringBuilder builder = new StringBuilder();
    SchemaVersion ver = version();
    final String startUpState = String.format(STARTUP_STATUS_MESSAGE_FMT, ver.getDBVersion(), ver.getPatchNo())
    try {
      allMigrated = migrateScripts();
      ver = repository.getVersion();
      logAndAppend(builder, startUpState);
      logAndAppend(builder, COMPLETED_STATUS_MESSAGE_FMT, ver.getDBVersion(), ver.getPatchNo());
    } finally {
      closeConnection();
      logAndAppend(builder, "%d script%s applied", scriptsApplied, ((scriptsApplied!=1)?"s":""));
      if (scriptsSkipped > 0) {
        logAndAppend(builder, "%d script%s skipped", scriptsSkipped, ((scriptsSkipped!=1)?"s":""));
View Full Code Here

      PreparedStatement getPatchStatement = scriptHistoryTableStatement(GET_PATCH_SQL);
      getPatchStatement.setLong(1, ver);
      getPatchStatement.setString(2, ScriptStatus.SKIPPED.getKey());
      getPatchStatement.setString(3, ScriptStatus.COMPLETED.getKey());
      Long patch = aslong(getFirstAsLong(getPatchStatement));
      SchemaVersion version = new SchemaVersionImpl(ver, patch);
      return version;
    } catch (SQLException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

    MockQry maxVerQry = new MockQry(String.format(GET_VERSION_SQL, EXPECTED_PATCH_HISTORY_TABLE));
    maxVerQry.queryFirstLong(returnDBVersion);
    MockQry maxPatch = new MockQry(String.format(GET_PATCH_SQL, EXPECTED_PATCH_HISTORY_TABLE));
    maxPatch.queryFirstLong(returnPatchNo);
   
    SchemaVersion ver = repos.getVersion();

    assertEquals(ver.getDBVersion(), expectedDBVersion);
    assertEquals(ver.getPatchNo(), expectedPatchNo);
    maxVerQry.checkQueryFirstLongCalls(returnDBVersion);
    maxPatch.checkQueryFirstLongCalls(returnPatchNo, (returnDBVersion==null||returnDBVersion<=0)?1l:returnDBVersion, ScriptStatus.SKIPPED.getKey(), ScriptStatus.COMPLETED.getKey());
  }
View Full Code Here

TOP

Related Classes of net.raymanoz.domain.SchemaVersion

Copyright © 2018 www.massapicom. 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.