migration fixes

This commit is contained in:
Efstratios Giannopoulos 2024-06-26 17:53:07 +03:00
parent c05f9e8fbd
commit 5e5efea33d
2 changed files with 3 additions and 2 deletions

View File

@ -188,7 +188,8 @@ public class DmpMigrationService {
switch (extraFieldEntity.getType()){ switch (extraFieldEntity.getType()){
case Date -> { case Date -> {
try { try {
valueEntity.setDateValue(Instant.parse((String) val)); if (((String) val).isBlank()) valueEntity.setDateValue(null);
else valueEntity.setDateValue(Instant.parse((String) val));
} catch (DateTimeParseException ex) { } catch (DateTimeParseException ex) {
valueEntity.setDateValue(LocalDate.parse((String) val).atStartOfDay().toInstant(ZoneOffset.UTC)); valueEntity.setDateValue(LocalDate.parse((String) val).atStartOfDay().toInstant(ZoneOffset.UTC));
} }