jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/schemawriter/H2SchemaWriter.java
@Override
  protected String makeAlterTableSqlString(
      String schema, String tableName, LinkedHashMap<String, JdbcTypeInfo> columnDiff
  ) {
    String tableSchema = (schema == null) ? getDefaultSchema() : schema;
    StringBuilder sqlString = new StringBuilder();
    boolean first = true;
    for (Map.Entry<String, JdbcTypeInfo> entry : columnDiff.entrySet()) {
      if (first) {
        first = false;
      } else {
        sqlString.append("\n");
      }
      sqlString
          .append(ALTER_TABLE)
          .append(" ");
      if (tableSchema != null) {
        sqlString.append(tableSchema);
        sqlString.append(".");
      }
      sqlString.append(tableName)
          .append(" ")
          .append("ADD COLUMN")
          .append(" ")
          .append(entry.getKey())
          .append(" ")
          .append(entry.getValue().toString())
          .append(";");
    }

    return sqlString.toString();
  }
@Override
  protected String makeAlterTableSqlString(
      String schema, String tableName, LinkedHashMap<String, JdbcTypeInfo> columnDiff
  ) {
    String tableSchema = (schema == null) ? getDefaultSchema() : schema;
    StringBuilder sqlString = new StringBuilder();
    boolean first = true;
    for (Map.Entry<String, JdbcTypeInfo> entry : columnDiff.entrySet()) {
      if (first) {
        first = false;
      } else {
        sqlString.append("\n");
      }
      sqlString
          .append(ALTER_TABLE)
          .append(" ");
      if (tableSchema != null) {
        sqlString.append(tableSchema);
        sqlString.append(".");
      }
      sqlString.append(tableName)
          .append(" ")
          .append("ADD COLUMN")
          .append(" ")
          .append(entry.getKey())
          .append(" ")
          .append(entry.getValue().toString())
          .append(";");
    }

    return sqlString.toString();
  }
@ Override protected String makeAlterTableSqlString ( String schema , String tableName , LinkedHashMap < String , JdbcTypeInfo > columnDiff ) { String tableSchema = ( schema == null ) ? getDefaultSchema ( ) : schema ; StringBuilder sqlString = new StringBuilder ( ) ; boolean first = true ; for ( Map . Entry < String , JdbcTypeInfo > entry : columnDiff . entrySet ( ) ) { if ( first ) { first = false ; } else { sqlString . append ( "\n" ) ; } sqlString . append ( ALTER_TABLE ) . append ( " " ) ; if ( tableSchema != null ) { sqlString . append ( tableSchema ) ; sqlString . append ( "." ) ; } sqlString . append ( tableName ) . append ( " " ) . append ( "ADD COLUMN" ) . append ( " " ) . append ( entry . getKey ( ) ) . append ( " " ) . append ( entry . getValue ( ) . toString ( ) ) . append ( ";" ) ; } return sqlString . toString ( ) ; }
H2 wants an ALTER TABLE command per column
H2 wants an ALTER TABLE command per column