Examples of MigrationReader


Examples of org.apache.ibatis.migration.MigrationReader

      for (Change change : migrations) {
        if (change.getId().equals(lastChange.getId())) {
          printStream.println(horizontalLine("Undoing: " + change.getFilename(), 80));
          ScriptRunner runner = getScriptRunner();
          try {
            runner.runScript(new MigrationReader(new FileReader(scriptFile(change.getFilename())), true, environmentProperties()));
          } finally {
            runner.closeConnection();
          }
          if (changelogExists()) {
            deleteChange(change);
View Full Code Here

Examples of org.apache.ibatis.migration.MigrationReader

      for (Change change : migrations) {
        if (lastChange == null || change.getId().compareTo(lastChange.getId()) > 0) {
          out.println(horizontalLine("Applying: " + change.getFilename(), 80));
          ScriptRunner runner = getScriptRunner();
          try {
            runner.runScript(new MigrationReader(new FileReader(scriptFile(change.getFilename())), false, environmentProperties()));
          } finally {
            runner.closeConnection();
          }
          insertChangelog(change);
          out.println();
View Full Code Here

Examples of org.apache.ibatis.migration.MigrationReader

        File bootstrap = scriptFile("bootstrap.sql");
        if (bootstrap.exists()) {
          out.println(horizontalLine("Applying: bootstrap.sql", 80));
          ScriptRunner runner = getScriptRunner();
          try {
            runner.runScript(new MigrationReader(new FileReader(bootstrap), false, environmentProperties()));
          } finally {
            runner.closeConnection();
          }
          out.println();
        } else {
View Full Code Here

Examples of org.apache.ibatis.migration.MigrationReader

      out.println("WARNING: Running pending migrations out of order can create unexpected results.");
      for (Change change : pending) {
        out.println(horizontalLine("Applying: " + change.getFilename(), 80));
        ScriptRunner runner = getScriptRunner();
        try {
          runner.runScript(new MigrationReader(new FileReader(scriptFile(change.getFilename())), false, environmentProperties()));
        } finally {
          runner.closeConnection();
        }
        insertChangelog(change);
        out.println();
View Full Code Here

Examples of org.apache.ibatis.migration.MigrationReader

      for (Change change : migrations) {
        if (change.getId().equals(lastChange.getId())) {
          out.println(horizontalLine("Undoing: " + change.getFilename(), 80));
          ScriptRunner runner = getScriptRunner();
          try {
            runner.runScript(new MigrationReader(new FileReader(scriptFile(change.getFilename())), true, environmentProperties()));
          } finally {
            runner.closeConnection();
          }
          if (changelogExists()) {
            deleteChange(change);
View Full Code Here

Examples of org.apache.ibatis.migration.MigrationReader

      for (Change change : migrations) {
        if (shouldRun(change, v1, v2)) {
          out.println("-- " + change.getFilename());
          File file = scriptFile(change.getFilename());
          FileReader fileReader = new FileReader(file);
          MigrationReader migrationReader = new MigrationReader(fileReader, undo, variables);
          char[] cbuf = new char[1024];
          int l;
          while ((l = migrationReader.read(cbuf)) == cbuf.length) {
            out.print(new String(cbuf, 0, l));
          }
          out.print(new String(cbuf, 0, l - 1));
          out.println();
          out.println();
View Full Code Here

Examples of org.apache.ibatis.migration.MigrationReader

      for (Change change : migrations) {
        if (lastChange == null || change.getId().compareTo(lastChange.getId()) > 0) {
          printStream.println(horizontalLine("Applying: " + change.getFilename(), 80));
          ScriptRunner runner = getScriptRunner();
          try {
            runner.runScript(new MigrationReader(new FileReader(scriptFile(change.getFilename())), false, environmentProperties()));
          } finally {
            runner.closeConnection();
          }
          insertChangelog(change);
          printStream.println();
View Full Code Here

Examples of org.apache.ibatis.migration.MigrationReader

        File bootstrap = scriptFile("bootstrap.sql");
        if (bootstrap.exists()) {
          printStream.println(horizontalLine("Applying: bootstrap.sql", 80));
          ScriptRunner runner = getScriptRunner();
          try {
            runner.runScript(new MigrationReader(new FileReader(bootstrap), false, environmentProperties()));
          } finally {
            runner.closeConnection();
          }
          printStream.println();
        } else {
View Full Code Here

Examples of org.apache.ibatis.migration.MigrationReader

      printStream.println("WARNING: Running pending migrations out of order can create unexpected results.");
      for (Change change : pending) {
        printStream.println(horizontalLine("Applying: " + change.getFilename(), 80));
        ScriptRunner runner = getScriptRunner();
        try {
          runner.runScript(new MigrationReader(new FileReader(scriptFile(change.getFilename())), false, environmentProperties()));
        } finally {
          runner.closeConnection();
        }
        insertChangelog(change);
        printStream.println();
View Full Code Here

Examples of org.apache.ibatis.migration.MigrationReader

      for (Change change : migrations) {
        if (change.getId().equals(lastChange.getId())) {
          printStream.println(horizontalLine("Undoing: " + change.getFilename(), 80));
          ScriptRunner runner = getScriptRunner();
          try {
            runner.runScript(new MigrationReader(new FileReader(scriptFile(change.getFilename())), true, environmentProperties()));
          } finally {
            runner.closeConnection();
          }
          if (changelogExists()) {
            deleteChange(change);
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.