Skip to content

Commit

Permalink
Allow sym_data row_data to be sync'd even if the original source tabl…
Browse files Browse the repository at this point in the history
…es don't exist in the database anymore.
  • Loading branch information
chenson42 committed Nov 16, 2012
1 parent c220ea9 commit 1d4f71e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Expand Up @@ -461,9 +461,7 @@ protected OutgoingBatch extractOutgoingBatch(Node targetNode,
currentBatch.isCommonFlag());
batch.setIgnored(true);
try {
IStagedResource resource = stagingManager.find(
Constants.STAGING_CATEGORY_OUTGOING, batch.getStagedLocation(),
batch.getBatchId());
IStagedResource resource = getStagedResource(currentBatch);
if (resource != null) {
resource.delete();
}
Expand Down Expand Up @@ -646,8 +644,8 @@ protected Table lookupAndOrderColumnsAccordingToTriggerHistory(String routerId,
Table table = symmetricDialect.getPlatform().getTableFromCache(catalogName, schemaName,
tableName, false);
if (table == null) {
throw new RuntimeException(String.format("Could not find the table, %s, to extract",
Table.getFullyQualifiedTableName(catalogName, schemaName, tableName)));
table = new Table(tableName);
table.addColumns(triggerHistory.getParsedColumnNames());
}
table = table.copyAndFilterColumns(triggerHistory.getParsedColumnNames(),
triggerHistory.getParsedPkColumnNames(), true);
Expand Down
8 changes: 8 additions & 0 deletions symmetric-db/src/main/java/org/jumpmind/db/model/Table.java
Expand Up @@ -306,6 +306,14 @@ public void addColumns(Collection<Column> columns) {
addColumn((Column) it.next());
}
}

public void addColumns(String[] columnNames) {
if (columnNames != null) {
for (String columnName : columnNames) {
addColumn(new Column(columnName));
}
}
}

/**
* Removes the given column.
Expand Down

0 comments on commit 1d4f71e

Please sign in to comment.