diff --git a/symmetric-client/src/main/java/org/jumpmind/symmetric/SymmetricAdmin.java b/symmetric-client/src/main/java/org/jumpmind/symmetric/SymmetricAdmin.java index 701edec1cc..5d4e6773dc 100644 --- a/symmetric-client/src/main/java/org/jumpmind/symmetric/SymmetricAdmin.java +++ b/symmetric-client/src/main/java/org/jumpmind/symmetric/SymmetricAdmin.java @@ -51,6 +51,7 @@ import org.jumpmind.security.SecurityConstants; import org.jumpmind.symmetric.common.ParameterConstants; import org.jumpmind.symmetric.model.Node; +import org.jumpmind.symmetric.model.TriggerHistory; import org.jumpmind.symmetric.service.IDataExtractorService; import org.jumpmind.symmetric.service.IDataLoaderService; import org.jumpmind.symmetric.service.IDataService; @@ -586,13 +587,27 @@ private void reloadTable(CommandLine line, List args) { } private void sendSchema(CommandLine line, List args) { - String tableName = popArg(args, "Table Name"); String catalog = line.getOptionValue(OPTION_CATALOG); String schema = line.getOptionValue(OPTION_SCHEMA); Collection nodes = getNodes(line); - for (Node node : nodes) { - getSymmetricEngine().getDataService().sendSchema(node.getNodeId(), catalog, schema, - tableName, false); + + if (args.size() == 0) { + for (TriggerHistory hist : engine.getTriggerRouterService().getActiveTriggerHistories()) { + for (Node node : nodes) { + if ((catalog == null || catalog.equals(hist.getSourceCatalogName())) && + (schema == null || schema.equals(hist.getSourceSchemaName()))) { + getSymmetricEngine().getDataService().sendSchema(node.getNodeId(), hist.getSourceCatalogName(), + hist.getSourceSchemaName(), hist.getSourceTableName(), false); + } + } + } + } else { + for (String tableName : args) { + for (Node node : nodes) { + getSymmetricEngine().getDataService().sendSchema(node.getNodeId(), catalog, + schema, tableName, false); + } + } } } diff --git a/symmetric-client/src/main/resources/symmetric-messages.properties b/symmetric-client/src/main/resources/symmetric-messages.properties index 1dee7fa7e5..0aa48021c0 100644 --- a/symmetric-client/src/main/resources/symmetric-messages.properties +++ b/symmetric-client/src/main/resources/symmetric-messages.properties @@ -89,7 +89,7 @@ SymAdmin.Usage.sync-triggers=[ ...] SymAdmin.Usage.drop-triggers=[ ...] SymAdmin.Usage.export-properties=[] SymAdmin.Usage.send-sql= -SymAdmin.Usage.send-schema=
+SymAdmin.Usage.send-schema=[
] ... SymAdmin.Usage.send-script= SymAdmin.Usage.uninstall= SymAdmin.Help.export-sym-tables=Output the SQL to create the SymmetricDS tables. If a filename is given, the SQL statements are written to it, otherwise standard output is used. @@ -109,7 +109,7 @@ SymAdmin.Help.create-war=Generate a web archive that can be deployed to a web se SymAdmin.Help.reload-node=Send an initial load of data to reload a remote node. SymAdmin.Help.reload-table=Send the data from the specified tables to a node or group of nodes. SymAdmin.Help.send-sql=Send a SQL statement to be executed on a remote node. -SymAdmin.Help.send-schema=Send a schema update for a table to be executed on a remote node. The table definition is sent in torque XML format. If the target table is missing, it is created; if it exists it will be altered, if possible, otherwise dropped and re-created. +SymAdmin.Help.send-schema=Send a schema update for a table to be executed on a remote node. The table definition is sent in torque XML format. If the target table is missing, it is created; if it exists it will be altered, if possible, otherwise dropped and re-created. Specify which tables to send or use no arguments to mean all configured tables. SymAdmin.Help.send-script=Send a script to a node to be run there. The script is read from the filename provided as an argument or read from standard input. Only BeanShell scripts are supported. SymAdmin.Help.uninstall=Uninstall all SymmetricDS objects from the database, including the SYM tables, sequences, functions, stored procedures, and triggers. SymAdmin.Option.catalog=Look for tables in catalog.