Skip to content

Commit

Permalink
derby trigger name are always upper case in catalog. drop post trigger.
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Dec 27, 2007
1 parent 7c2d507 commit 7b1db95
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -43,15 +43,20 @@ public boolean isFunctionUpToDate(String name) throws Exception {
protected boolean doesTriggerExistOnPlatform(String schema, String tableName, String triggerName) {
schema = schema == null ? (getDefaultSchema() == null ? null : getDefaultSchema()) : schema;
return jdbcTemplate.queryForInt("select count(*) from sys.systriggers where triggername = ?",
new Object[] { triggerName }) > 0;
new Object[] { triggerName.toUpperCase() }) > 0;
}

public void removeTrigger(String schemaName, String triggerName) {
schemaName = schemaName == null ? "" : (schemaName + ".");
try {
jdbcTemplate.update("drop trigger " + schemaName + triggerName);
} catch (Exception e) {
logger.warn("Trigger does not exist");
logger.warn("Trigger " + triggerName + " does not exist");
}
try {
jdbcTemplate.update("drop trigger " + schemaName + triggerName + "p");
} catch (Exception e) {
logger.warn("Trigger " + triggerName + "p does not exist");
}
}

Expand Down

0 comments on commit 7b1db95

Please sign in to comment.