Skip to content

Commit

Permalink
feat(persistence): add console logger to db init transaction (comment…
Browse files Browse the repository at this point in the history
…ed out, but useful for debugging)
  • Loading branch information
pmoscode committed May 11, 2023
1 parent d799a8d commit 0023056
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
package org.eclipse.tractusx.managedidentitywallets.plugins

import io.ktor.application.*
import org.eclipse.tractusx.managedidentitywallets.persistence.entities.*
import org.eclipse.tractusx.managedidentitywallets.persistence.entities.KeyReferences
import org.eclipse.tractusx.managedidentitywallets.persistence.entities.VerifiableCredentials
import org.eclipse.tractusx.managedidentitywallets.persistence.entities.Wallets
import org.jetbrains.exposed.sql.Database
import org.jetbrains.exposed.sql.SchemaUtils
import org.jetbrains.exposed.sql.transactions.transaction
Expand All @@ -30,12 +32,14 @@ fun Application.configurePersistence() {
val jdbcDriver = environment.config.property("db.jdbcDriver").getString()
Database.connect(jdbcUrl, driver = jdbcDriver)
transaction {
// addLogger(StdOutSqlLogger)

// Create missing tables
SchemaUtils.createMissingTablesAndColumns(
Wallets,
VerifiableCredentials,
KeyReferences
)
commit()
}
}
}

0 comments on commit 0023056

Please sign in to comment.