Skip to content

Commit

Permalink
0005903: Failing to create trigger on table
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Marzullo committed Jul 5, 2023
1 parent c7e99a5 commit 552291b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
Expand Up @@ -503,12 +503,6 @@ protected String replaceTemplateVariables(DataEventType dml, Trigger trigger,
{
ddl = super.replaceTemplateVariables(dml, trigger, history, channel, tablePrefix, originalTable, table,
defaultCatalog, defaultSchema, ddl);
Column[] columns = table.getPrimaryKeyColumns();
ddl = FormatUtils.replace("declareOldKeyVariables",
buildKeyVariablesDeclare(columns, "old"), ddl);
ddl = FormatUtils.replace("declareNewKeyVariables",
buildKeyVariablesDeclare(columns, "new"), ddl);

ddl = FormatUtils.replace("anyNonBlobColumnChanged",
buildNonLobColumnsAreNotEqualString(table, newTriggerValue, oldTriggerValue), ddl);

Expand Down
Expand Up @@ -22,8 +22,15 @@

import java.util.HashMap;

import org.jumpmind.db.model.Column;
import org.jumpmind.db.model.Table;
import org.jumpmind.symmetric.db.ISymmetricDialect;
import org.jumpmind.symmetric.db.mssql.MsSqlTriggerTemplate;
import org.jumpmind.symmetric.io.data.DataEventType;
import org.jumpmind.symmetric.model.Channel;
import org.jumpmind.symmetric.model.Trigger;
import org.jumpmind.symmetric.model.TriggerHistory;
import org.jumpmind.util.FormatUtils;

public class MsSql2000TriggerTemplate extends MsSqlTriggerTemplate {
public MsSql2000TriggerTemplate(ISymmetricDialect symmetricDialect) {
Expand Down Expand Up @@ -203,4 +210,18 @@ public MsSql2000TriggerTemplate(ISymmetricDialect symmetricDialect) {

}

@Override
protected String replaceTemplateVariables(DataEventType dml, Trigger trigger,
TriggerHistory history, Channel channel, String tablePrefix, Table originalTable, Table table,
String defaultCatalog, String defaultSchema, String ddl)
{
ddl = super.replaceTemplateVariables(dml, trigger, history, channel, tablePrefix, originalTable, table,
defaultCatalog, defaultSchema, ddl);
Column[] columns = table.getPrimaryKeyColumns();
ddl = FormatUtils.replace("declareOldKeyVariables",
buildKeyVariablesDeclare(columns, "old"), ddl);
ddl = FormatUtils.replace("declareNewKeyVariables",
buildKeyVariablesDeclare(columns, "new"), ddl);
return ddl;
}
}

0 comments on commit 552291b

Please sign in to comment.