Skip to content

Commit

Permalink
0002748: the Table 'sym_trigger' can not be created on informix
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Sep 10, 2016
1 parent adc399b commit 1c7030a
Showing 1 changed file with 11 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,17 @@ public String beforeUpgrade(ISymmetricDialect symmetricDialect, String tablePref
}

if (engine.getDatabasePlatform().getName().equals(DatabaseNamesConstants.INFORMIX)) {
String triggerTableName = tablePrefix + "_" + TableConstants.SYM_TRIGGER;
convertToMaxVarchar(desiredModel, triggerTableName, "custom_before_insert_text");
convertToMaxVarchar(desiredModel, triggerTableName, "custom_before_update_text");
convertToMaxVarchar(desiredModel, triggerTableName, "custom_before_delete_text");
convertToMaxVarchar(desiredModel, triggerTableName, "included_column_names");
Table triggerTable = desiredModel.findTable(tablePrefix + "_" + TableConstants.SYM_TRIGGER);
if (triggerTable != null) {
for (Column column : triggerTable.getColumns()) {
if (column.getMappedType().equals("LVARCHAR")) {
column.setJdbcTypeCode(Types.VARCHAR);
column.setMappedType("VARCHAR");
column.setMappedTypeCode(Types.VARCHAR);
column.setSize("255");
}
}
}
}
return sb.toString();
}
Expand Down Expand Up @@ -120,19 +126,6 @@ protected void dropTriggers(Database currentModel, String tableName, String colu
}
}
}

protected void convertToMaxVarchar(Database model, String tableName, String columnName) {
Table triggerTable = model.findTable(tableName);
if (triggerTable != null) {
Column column = triggerTable.findColumn(columnName);
if (column != null) {
column.setJdbcTypeCode(Types.VARCHAR);
column.setMappedType("VARCHAR");
column.setMappedTypeCode(Types.VARCHAR);
column.setSize("255");
}
}
}

@Override
public void setSymmetricEngine(ISymmetricEngine engine) {
Expand Down

0 comments on commit 1c7030a

Please sign in to comment.