diff --git a/backend/build.gradle b/backend/build.gradle index e7ee3f5fa..9c0484161 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -37,11 +37,11 @@ dependencies { implementation "org.postgresql:postgresql:42.7.4" implementation "org.apache.commons:commons-csv:1.12.0" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0" - implementation "org.flywaydb:flyway-database-postgresql:10.20.1" - implementation "org.jetbrains.exposed:exposed-spring-boot-starter:0.55.0" - implementation "org.jetbrains.exposed:exposed-jdbc:0.55.0" - implementation "org.jetbrains.exposed:exposed-json:0.55.0" - implementation "org.jetbrains.exposed:exposed-kotlin-datetime:0.55.0" + implementation "org.flywaydb:flyway-database-postgresql:10.21.0" + implementation "org.jetbrains.exposed:exposed-spring-boot-starter:0.56.0" + implementation "org.jetbrains.exposed:exposed-jdbc:0.56.0" + implementation "org.jetbrains.exposed:exposed-json:0.56.0" + implementation "org.jetbrains.exposed:exposed-kotlin-datetime:0.56.0" implementation "org.jetbrains.kotlinx:kotlinx-datetime:0.6.1" implementation "org.hibernate.validator:hibernate-validator:8.0.1.Final" implementation "org.keycloak:keycloak-admin-client:23.0.7" diff --git a/backend/src/main/kotlin/org/loculus/backend/service/seqsetcitations/SeqSetCitationsDatabaseService.kt b/backend/src/main/kotlin/org/loculus/backend/service/seqsetcitations/SeqSetCitationsDatabaseService.kt index 6c3de15b2..6a6ddddd3 100644 --- a/backend/src/main/kotlin/org/loculus/backend/service/seqsetcitations/SeqSetCitationsDatabaseService.kt +++ b/backend/src/main/kotlin/org/loculus/backend/service/seqsetcitations/SeqSetCitationsDatabaseService.kt @@ -85,7 +85,7 @@ class SeqSetCitationsDatabaseService( .insert { it[SeqSetRecordsTable.accession] = record.accession it[SeqSetRecordsTable.type] = record.type - it[SeqSetRecordsTable.isFocal] = record.isFocal ?: true + it[SeqSetRecordsTable.isFocal] = record.isFocal } SeqSetToRecordsTable .insert { @@ -119,6 +119,7 @@ class SeqSetCitationsDatabaseService( .where { SeqSetsTable.seqSetId eq seqSetId and (SeqSetsTable.createdBy eq username) } .firstOrNull() ?.get(SeqSetsTable.seqSetVersion.max()) + as Long? if (maxVersion == null) { throw NotFoundException("SeqSet $seqSetId does not exist") @@ -158,7 +159,7 @@ class SeqSetCitationsDatabaseService( .insert { it[SeqSetRecordsTable.accession] = record.accession it[SeqSetRecordsTable.type] = record.type - it[SeqSetRecordsTable.isFocal] = record.isFocal ?: true + it[SeqSetRecordsTable.isFocal] = record.isFocal } insertedRecord[SeqSetRecordsTable.seqSetRecordId] } else { @@ -469,7 +470,7 @@ class SeqSetCitationsDatabaseService( val (accession, version) = it.accession.split('.') AccessionVersion(accession, version.toLong()) } - } catch (e: NumberFormatException) { + } catch (_: NumberFormatException) { throw UnprocessableEntityException("Accession versions must be integers") }