refactor: simplify UUID processing and standardize SchemaUtils usage
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, api-gateway, api-gateway) (push) Failing after 4m57s
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Failing after 2m57s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Successful in 7m26s
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Successful in 1m55s
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, api-gateway, api-gateway) (push) Failing after 4m57s
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Failing after 2m57s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Successful in 7m26s
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Successful in 1m55s
- Removed unnecessary UUID casting in repositories (`ExposedFunktionaerRepository`, `ExposedReiterRepository`, `ExposedVereinRepository`). - Replaced `SchemaUtils.createMissingTablesAndColumns` with `SchemaUtils.create` in database configuration for consistency. Signed-off-by: Stefan Mogeritsch <stefan.mo.co@gmail.com>
This commit is contained in:
+1
-2
@@ -15,7 +15,6 @@ import org.jetbrains.exposed.v1.jdbc.insert
|
||||
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||
import org.jetbrains.exposed.v1.jdbc.update
|
||||
import java.util.*
|
||||
import kotlin.time.Clock
|
||||
import kotlin.uuid.Uuid
|
||||
import kotlin.uuid.toJavaUuid
|
||||
@@ -100,7 +99,7 @@ class ExposedVereinRepository : VereinRepository {
|
||||
}
|
||||
|
||||
private fun rowToVerein(row: ResultRow): DomVerein = DomVerein(
|
||||
vereinId = (row[VereinTable.id] as UUID).toKotlinUuid(),
|
||||
vereinId = row[VereinTable.id].toKotlinUuid(),
|
||||
vereinsNummer = row[VereinTable.vereinsNummer],
|
||||
name = row[VereinTable.name],
|
||||
kurzname = row[VereinTable.kurzname],
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ class EntriesDatabaseConfiguration {
|
||||
log.info("Initialisiere Datenbank-Schema für Entries Service...")
|
||||
try {
|
||||
transaction {
|
||||
SchemaUtils.createMissingTablesAndColumns(
|
||||
SchemaUtils.create(
|
||||
NennungTable,
|
||||
NennungsTransferTable
|
||||
)
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@ class EventsDatabaseConfiguration {
|
||||
// Database connection is already initialized by the gateway
|
||||
// Only initialize the schema for this service
|
||||
transaction {
|
||||
SchemaUtils.createMissingTablesAndColumns(VeranstaltungTable)
|
||||
SchemaUtils.create(VeranstaltungTable)
|
||||
log.info("Events database schema initialized successfully")
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
@@ -82,7 +82,7 @@ class EventsTestDatabaseConfiguration {
|
||||
|
||||
// Initialize database schema for tests
|
||||
transaction {
|
||||
SchemaUtils.createMissingTablesAndColumns(VeranstaltungTable)
|
||||
SchemaUtils.create(VeranstaltungTable)
|
||||
log.info("Test events database schema initialized successfully")
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
|
||||
+2
-2
@@ -34,7 +34,7 @@ class MasterdataDatabaseConfiguration {
|
||||
// Database connection is already initialized by the gateway
|
||||
// Only initialize the schema for this service
|
||||
transaction {
|
||||
SchemaUtils.createMissingTablesAndColumns(
|
||||
SchemaUtils.create(
|
||||
LandTable,
|
||||
BundeslandTable,
|
||||
AltersklasseTable,
|
||||
@@ -90,7 +90,7 @@ class MasterdataTestDatabaseConfiguration {
|
||||
|
||||
// Initialize database schema for tests
|
||||
transaction {
|
||||
SchemaUtils.createMissingTablesAndColumns(
|
||||
SchemaUtils.create(
|
||||
LandTable,
|
||||
BundeslandTable,
|
||||
AltersklasseTable,
|
||||
|
||||
+1
-2
@@ -16,7 +16,6 @@ import org.jetbrains.exposed.v1.jdbc.insert
|
||||
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||
import org.jetbrains.exposed.v1.jdbc.update
|
||||
import java.util.*
|
||||
import kotlin.time.Clock
|
||||
import kotlin.uuid.Uuid
|
||||
import kotlin.uuid.toJavaUuid
|
||||
@@ -145,7 +144,7 @@ class ExposedFunktionaerRepository : FunktionaerRepository {
|
||||
}
|
||||
|
||||
return DomFunktionaer(
|
||||
funktionaerId = (row[FunktionaerTable.id] as UUID).toKotlinUuid(),
|
||||
funktionaerId = row[FunktionaerTable.id].toKotlinUuid(),
|
||||
richterNummer = row[FunktionaerTable.richterNummer],
|
||||
vorname = row[FunktionaerTable.vorname],
|
||||
nachname = row[FunktionaerTable.nachname],
|
||||
|
||||
+2
-3
@@ -15,7 +15,6 @@ import org.jetbrains.exposed.v1.jdbc.insert
|
||||
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||
import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
||||
import org.jetbrains.exposed.v1.jdbc.update
|
||||
import java.util.*
|
||||
import kotlin.time.Clock
|
||||
import kotlin.uuid.Uuid
|
||||
import kotlin.uuid.toJavaUuid
|
||||
@@ -132,8 +131,8 @@ class ExposedReiterRepository : ReiterRepository {
|
||||
}
|
||||
|
||||
return DomReiter(
|
||||
reiterId = (row[ReiterTable.id] as UUID).toKotlinUuid(),
|
||||
personId = (row[ReiterTable.id] as UUID).toKotlinUuid(), // same as reiterId for now
|
||||
reiterId = row[ReiterTable.id].toKotlinUuid(),
|
||||
personId = row[ReiterTable.id].toKotlinUuid(), // same as reiterId for now
|
||||
satznummer = row[ReiterTable.satznummer] ?: "",
|
||||
feiId = row[ReiterTable.feiId],
|
||||
nation = row[ReiterTable.nation],
|
||||
|
||||
Reference in New Issue
Block a user