Skip to content

Commit

Permalink
0004925: Add a new parameter that allows you to control the trigger p…
Browse files Browse the repository at this point in the history
…refix independent of the table prefix (#154)
  • Loading branch information
chenson42 committed Mar 29, 2021
1 parent 88d4155 commit 096d573
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Expand Up @@ -320,6 +320,7 @@ private ParameterConstants() {
public final static String DB_JNDI_NAME = "db.jndi.name";
public final static String DB_SPRING_BEAN_NAME = "db.spring.bean.name";

public final static String RUNTIME_CONFIG_TRIGGER_PREFIX = "sync.trigger.prefix";
public final static String RUNTIME_CONFIG_TABLE_PREFIX = "sync.table.prefix";

public final static String NODE_ID_CREATOR_SCRIPT = "node.id.creator.script";
Expand Down
Expand Up @@ -2009,7 +2009,8 @@ public String getTriggerName(DataEventType dml, int maxTriggerNameLength, Trigge
}

if (StringUtils.isBlank(triggerName)) {
String triggerPrefix1 = tablePrefix + "_";
String triggerPrefix = parameterService.getString(ParameterConstants.RUNTIME_CONFIG_TRIGGER_PREFIX, tablePrefix);
String triggerPrefix1 = triggerPrefix + "_";
String triggerSuffix1 = "on_" + dml.getCode().toLowerCase() + "_for_";
String triggerSuffix2 = FormatUtils.replaceCharsToShortenName(trigger.getTriggerId());
if (trigger.isSourceTableNameWildCarded()) {
Expand Down
Expand Up @@ -285,6 +285,11 @@ target.log.slow.sql.threshold.millis=
# Tags: database
target.log.sql.parameters.inline=

# When symmetric triggers are created and accessed, this is the prefix to use for the tables.
# If this is not set, it will use the sync.table.prefix as the trigger prefix
# Tags: database
sync.trigger.prefix=

# When symmetric tables are created and accessed, this is the prefix to use for the tables.
#
# Tags: database
Expand Down

0 comments on commit 096d573

Please sign in to comment.