Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
-
6192e476
by Tony Chemit at 2020-05-26T10:56:56+02:00
4 changed files:
- persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_6.java
- test/src/main/resources/db/7.6/dataForTestLongline.sql.gz
- test/src/main/resources/db/7.6/dataForTestSeine.sql.gz
- test/src/main/resources/db/7.6/referentiel.sql.gz
Changes:
| ... | ... | @@ -27,12 +27,14 @@ import org.apache.commons.lang3.tuple.Pair; |
| 27 | 27 |
import org.nuiton.topia.persistence.support.TopiaSqlQuery;
|
| 28 | 28 |
import org.nuiton.topia.service.migration.resources.MigrationVersionResource;
|
| 29 | 29 |
import org.nuiton.topia.service.migration.resources.MigrationVersionResourceExecutor;
|
| 30 |
+import org.nuiton.util.DateUtil;
|
|
| 30 | 31 |
import org.nuiton.version.Versions;
|
| 31 | 32 |
|
| 32 | 33 |
import java.sql.Connection;
|
| 33 | 34 |
import java.sql.PreparedStatement;
|
| 34 | 35 |
import java.sql.ResultSet;
|
| 35 | 36 |
import java.sql.SQLException;
|
| 37 |
+import java.util.Date;
|
|
| 36 | 38 |
import java.util.Set;
|
| 37 | 39 |
|
| 38 | 40 |
/**
|
| ... | ... | @@ -72,7 +74,7 @@ public class DataSourceMigrationForVersion_7_6 extends MigrationVersionResource |
| 72 | 74 |
// Must be a ## starting comment
|
| 73 | 75 |
continue;
|
| 74 | 76 |
}
|
| 75 |
- String homeId = comment.substring(1, endIndex - 1);
|
|
| 77 |
+ String homeId = comment.substring(1, endIndex);
|
|
| 76 | 78 |
String newComment = endIndex + 1 == comment.length() ? "NULL" : (String.format("'%s'", comment.substring(endIndex + 1).trim().replaceAll("'","''")));
|
| 77 | 79 |
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));
|
| 78 | 80 |
}
|
No preview for this file type
No preview for this file type
No preview for this file type