Description | "Here's a suggested improvement to synchronize tables to same schema/catalog in target if source_schema_name / source_catalog_name is defined for trigger and target schema name / catalog name hasn't been defined in the router. This is a ""breaking change"" and maybe there should be a configuration parameter to control the behaviour? Maybe add a property to router? (keep source schema / keep source catalog) I haven't tested this patch, but I assume this would be the correct place to add the change: {code} Index: src/main/java/org/jumpmind/symmetric/extract/csv/CsvExtractor.java =================================================================== --- src/main/java/org/jumpmind/symmetric/extract/csv/CsvExtractor.java (revision 3175) +++ src/main/java/org/jumpmind/symmetric/extract/csv/CsvExtractor.java (working copy) @@ -24,6 +24,7 @@ import java.io.BufferedWriter; import java.io.IOException; +import org.apache.commons.lang.StringUtils; import org.jumpmind.symmetric.common.ParameterConstants; import org.jumpmind.symmetric.common.csv.CsvConstants; import org.jumpmind.symmetric.extract.DataExtractorContext; @@ -88,11 +89,11 @@ protected void writeTable(Data data, String routerId, BufferedWriter out) throws IOException { // TODO Add property and write the source schema and the source catalog if set Router router = triggerRouterService.getRouterByIdForCurrentNode(routerId, false); - String schemaName = (router == null || router.getTargetSchemaName() == null) ? """" : router + String schemaName = (router == null || router.getTargetSchemaName() == null) ? StringUtils.trimToEmpty(data.getTriggerHistory().getSourceSchemaName()) : router .getTargetSchemaName(); CsvUtils.write(out, CsvConstants.SCHEMA, "", "", schemaName); out.newLine(); - String catalogName = (router == null || router.getTargetCatalogName() == null) ? """" : router + String catalogName = (router == null || router.getTargetCatalogName() == null) ? StringUtils.trimToEmpty(data.getTriggerHistory().getSourceCatalogName()) : router .getTargetCatalogName(); CsvUtils.write(out, CsvConstants.CATALOG, "", "", catalogName); out.newLine(); {code}" |
---|