[recreation] set forcedRecreation from AlterDatabaseJava
authorAsier Lostalé <asier.lostale@openbravo.com>
Mon, 20 Apr 2015 13:21:49 +0200
changeset 594 6ddd3202babd
parent 593 15606248ea9f
child 595 3871d3224813
[recreation] set forcedRecreation from AlterDatabaseJava
src/org/openbravo/ddlutils/task/AlterDatabaseDataAll.java
src/org/openbravo/ddlutils/task/AlterDatabaseJava.java
--- a/src/org/openbravo/ddlutils/task/AlterDatabaseDataAll.java	Mon Apr 20 13:21:15 2015 +0200
+++ b/src/org/openbravo/ddlutils/task/AlterDatabaseDataAll.java	Mon Apr 20 13:21:49 2015 +0200
@@ -22,6 +22,7 @@
 import java.util.Vector;
 
 import org.apache.commons.dbcp.BasicDataSource;
+import org.apache.commons.lang.StringUtils;
 import org.apache.ddlutils.Platform;
 import org.apache.ddlutils.PlatformFactory;
 import org.apache.ddlutils.alteration.Change;
@@ -100,6 +101,11 @@
         getPassword());
 
     final Platform platform = PlatformFactory.createNewPlatformInstance(ds);
+
+    if (!StringUtils.isEmpty(forcedRecreation)) {
+      getLog().info("Forced recreation: " + forcedRecreation);
+    }
+
     platform.getSqlBuilder().setForcedRecreation(forcedRecreation);
     // platform.setDelimitedIdentifierModeOn(true);
     DBSMOBUtil
--- a/src/org/openbravo/ddlutils/task/AlterDatabaseJava.java	Mon Apr 20 13:21:15 2015 +0200
+++ b/src/org/openbravo/ddlutils/task/AlterDatabaseJava.java	Mon Apr 20 13:21:49 2015 +0200
@@ -34,7 +34,13 @@
     String strict = args[16];
     if (strict.equalsIgnoreCase("yes"))
       strict = "true";
+
     ada.setStrict(new Boolean(strict).booleanValue());
+
+    if (args.length > 17) {
+      ada.setForcedRecreation(args[17]);
+    }
+
     ada.execute();
 
   }