Skip to content

Commit

Permalink
need to detect trigger object in schema
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Dec 20, 2007
1 parent be1a6f3 commit 2577981
Showing 1 changed file with 10 additions and 3 deletions.
Expand Up @@ -40,16 +40,23 @@ public boolean isFunctionUpToDate(String name) throws Exception {
return true;
}

@Override
protected boolean doesTriggerExistOnPlatform(String schema, String tableName, String triggerName) {
return true;
schema = schema == null ? (getDefaultSchema() == null ? null : getDefaultSchema()) : schema;
return jdbcTemplate.queryForInt("select count(*) from sys.systriggers where triggername = ?",
new Object[] { triggerName }) > 0;
}

public void removeTrigger(String schemaName, String triggerName) {
throw new RuntimeException("Not implemented. Use removeTrigger(schema, trigger, table) instead.");
schemaName = schemaName == null ? "" : (schemaName + ".");
try {
jdbcTemplate.update("drop trigger " + schemaName + triggerName);
} catch (Exception e) {
logger.warn("Trigger does not exist");
}
}

public void removeTrigger(String schemaName, String triggerName, String tableName) {
removeTrigger(schemaName, triggerName);
}

public void disableSyncTriggers() {
Expand Down

0 comments on commit 2577981

Please sign in to comment.