Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: 1579f66f by tchemit at 2019-02-03T11:28:23Z Problème d'ouverture d'une sauvegarde 5.4 - Closes #1184 - - - - - 1 changed file: - persistence/src/main/java/fr/ird/observe/entities/migration/old/DataSourceMigrationForVersion_6_0.java Changes: ===================================== persistence/src/main/java/fr/ird/observe/entities/migration/old/DataSourceMigrationForVersion_6_0.java ===================================== @@ -179,6 +179,7 @@ public class DataSourceMigrationForVersion_6_0 extends OldMigrationVersionResour .put("fr.ird.observe.entities.referentiel.SizeMeasureType#1433499470887#0.950930784922093", "INSERT INTO observe_common.sizemeasuretype (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, uri, label1, label2, label3, label4, label5, label6, label7, label8, needcomment) VALUES ('fr.ird.observe.entities.referentiel.SizeMeasureType#1433499470887#0.950930784922093', 2, '2015-06-05', '2016-10-18 11:51:54.099140', 'DML', 1, null, 'Dorsal Mantle Length', 'Dorsal Mantle Length', 'Dorsal Mantle Length', null, null, null, null, null, false);") .put("fr.ird.observe.entities.referentiel.SizeMeasureType#1433499471278#0.425988764036447", "INSERT INTO observe_common.sizemeasuretype (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, uri, label1, label2, label3, label4, label5, label6, label7, label8, needcomment) VALUES ('fr.ird.observe.entities.referentiel.SizeMeasureType#1433499471278#0.425988764036447', 2, '2015-06-05', '2016-10-18 11:51:54.099140', 'CDML', 1, null, 'Curved Dorsal Mantle Length', 'Curved Dorsal Mantle Length', 'Curved Dorsal Mantle Length', null, null, null, null, null, false);") .put("fr.ird.observe.entities.referentiel.SizeMeasureType#1433499472220#0.885759855154902", "INSERT INTO observe_common.sizemeasuretype (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, uri, label1, label2, label3, label4, label5, label6, label7, label8, needcomment) VALUES ('fr.ird.observe.entities.referentiel.SizeMeasureType#1433499472220#0.885759855154902', 2, '2015-06-05', '2016-10-18 11:51:54.099140', 'PFL', 1, null, 'Pectoral-Fork Length', 'Pectoral-Fork Length', 'Pectoral-Fork Length', null, null, null, null, null, false);") + .put("fr.ird.observe.entities.referentiel.SizeMeasureType#1479120383659#0.03964411579456617", "INSERT INTO observe_common.sizemeasuretype (topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, uri, label1, label2, label3, label4, label5, label6, label7, label8, needcomment) VALUES ('fr.ird.observe.entities.referentiel.SizeMeasureType#1479120383659#0.03964411579456617', 2, '2016-11-14', '2016-12-06 15:54:27.727005', 'SCL', 1, null, 'Straight Carapace Length', 'Straight Carapace Length', 'Straight Carapace Length', null, null, null, null, null, false);") .build(); ImmutableMap<String, String> knownSizeMeasureTypeMapping = ImmutableMap.<String, String>builder() @@ -258,7 +259,11 @@ public class DataSourceMigrationForVersion_6_0 extends OldMigrationVersionResour Set<String> missingSizeMeasureTypeIds = knownSizeMeasureTypeMapping.values().stream().filter(id -> !existingSizeMeasureMapping.values().contains(id)).collect(Collectors.toSet()); for (String missingSizeMeasureTypeId : missingSizeMeasureTypeIds) { - executor.writeSql(sqlMappingByCode.get(missingSizeMeasureTypeId)); + String sql = sqlMappingByCode.get(missingSizeMeasureTypeId); + if (sql == null) { + throw new IllegalStateException("Can't fin size measure type with id: " + missingSizeMeasureTypeId); + } + executor.writeSql(sql); } ImmutableMap.Builder<String, String> allSizeMeasureTypeMappingBuilder = ImmutableMap.<String, String>builder().putAll(existingSizeMeasureMapping); View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/1579f66fe41505621c7d07e3569b... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/1579f66fe41505621c7d07e3569b... You're receiving this email because of your account on gitlab.com.