Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe

Commits:

1 changed file:

Changes:

  • persistence/src/main/java/fr/ird/observe/entities/migration/DataSourceMigrationForVersion_7_6.java
    ... ... @@ -68,6 +68,10 @@ public class DataSourceMigrationForVersion_7_6 extends MigrationVersionResource
    68 68
                 String comment = pair.getValue().trim();
    
    69 69
     
    
    70 70
                 int endIndex = comment.indexOf('#', 1);
    
    71
    +            if (endIndex == 1) {
    
    72
    +                // Must be a ## starting comment
    
    73
    +                continue;
    
    74
    +            }
    
    71 75
                 String homeId = comment.substring(1, endIndex - 1);
    
    72 76
                 String newComment = endIndex + 1 == comment.length() ? "NULL" : (String.format("'%s'", comment.substring(endIndex + 1).trim().replaceAll("'","''")));
    
    73 77
                 executor.writeSql(String.format("UPDATE observe_seine.trip t SET comment = %s, homeId = '%s', topiaVersion = topiaVersion + 1, lastUpdateDate = CURRENT_TIMESTAMP WHERE t.topiaId = '%s';", newComment, homeId, tripId));