From 78c36bffff46c3dd8bb68492a87ba65c98d2c69f Mon Sep 17 00:00:00 2001 From: Alejandro Revilla Date: Fri, 29 Sep 2017 00:10:49 -0300 Subject: [PATCH] support config modifier --- .../src/main/java/org/jpos/q2/cli/CREATESCHEMA.java | 8 ++++++-- .../src/main/resources/org/jpos/q2/cli/CREATESCHEMA.man | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/dbsupport/src/main/java/org/jpos/q2/cli/CREATESCHEMA.java b/modules/dbsupport/src/main/java/org/jpos/q2/cli/CREATESCHEMA.java index 7a6f8f4108..abc3c4f3d7 100644 --- a/modules/dbsupport/src/main/java/org/jpos/q2/cli/CREATESCHEMA.java +++ b/modules/dbsupport/src/main/java/org/jpos/q2/cli/CREATESCHEMA.java @@ -26,13 +26,17 @@ public class CREATESCHEMA implements CLICommand { @Override public void exec(CLIContext cli, String[] args) throws Exception { - String filename = "-"; // defaults to stdout + String filename = "-"; // defaults to stdout ' + String configModifier = null; boolean create = false; if (args.length > 1) filename = args[1]; if (args.length > 2) create = "yes".equalsIgnoreCase(args[2]) || "true".equalsIgnoreCase(args[2]); - try (DB db = new DB()) { + if (args.length > 3) + configModifier = args[3]; + + try (DB db = new DB(configModifier)) { db.open(); db.beginTransaction(); db.createSchema(filename, create); diff --git a/modules/dbsupport/src/main/resources/org/jpos/q2/cli/CREATESCHEMA.man b/modules/dbsupport/src/main/resources/org/jpos/q2/cli/CREATESCHEMA.man index 8062914f99..4607c0e627 100644 --- a/modules/dbsupport/src/main/resources/org/jpos/q2/cli/CREATESCHEMA.man +++ b/modules/dbsupport/src/main/resources/org/jpos/q2/cli/CREATESCHEMA.man @@ -1,5 +1,6 @@ -Usage: createschema [filename] [export] +Usage: createschema [filename] [export] [config-modifier] * 'filename' to store the SQL script (useful in a dry run) * if 'export' is 'yes', the script will be exported to the database +* optional 'config-modifier'