// "ALTER TABLE $childTableName$ " +
// "ADD $constraint$ $constraintName$ FOREIGN KEY ( $childColumn; separator=\",\"$ ) " +
// "REFERENCES $parentTableName$ ( $parentColumn; separator=\",\"$ )";
final StringTemplate fkST = new StringTemplate(ST_ADD_FOREIGN_KEY_CONSTRAINT_STYLE_ONE);
final HashMap<String, String> fkValuesMap =
DialectUtils.getValuesMap(ST_CHILD_TABLE_KEY, localTableName);
fkValuesMap.put(ST_CONSTRAINT_KEY, "CONSTRAINT");
fkValuesMap.put(ST_CONSTRAINT_NAME_KEY, constraintName);
fkValuesMap.put(ST_PARENT_TABLE_KEY, refTableName);
StringTemplate childIndexST = null;
HashMap<String, String> ckIndexValuesMap = null;
if (autoFKIndex)
{
// "CREATE $unique$ $storageOption$ INDEX $indexName$ " +
// "ON $tableName$ ( $columnName; separator=\",\"$ )";
childIndexST = new StringTemplate(ST_CREATE_INDEX_STYLE_TWO);
ckIndexValuesMap = new HashMap<String, String>();
ckIndexValuesMap.put(ST_INDEX_NAME_KEY, "fk_child_idx");
}
return DialectUtils.getAddForeignKeyConstraintSQL(fkST, fkValuesMap, childIndexST, ckIndexValuesMap,