Phase 1 work

This commit is contained in:
2026-04-24 20:21:03 +02:00
parent b36058fa79
commit 68655eae1a
22 changed files with 126 additions and 65 deletions

View File

@@ -17,7 +17,9 @@ fun main() {
}
@Serializable
private data class Health(val status: String)
private data class Health(
val status: String,
)
fun Application.module() {
install(ContentNegotiation) {

View File

@@ -8,14 +8,24 @@ object Database {
private val log = LoggerFactory.getLogger(Database::class.java)
fun migrate(app: Application) {
val url = app.environment.config.property("database.url").getString()
val user = app.environment.config.property("database.user").getString()
val password = app.environment.config.property("database.password").getString()
val url =
app.environment.config
.property("database.url")
.getString()
val user =
app.environment.config
.property("database.user")
.getString()
val password =
app.environment.config
.property("database.password")
.getString()
log.info("Connecting to {} as {} and running Flyway migrations", url, user)
runCatching {
Flyway.configure()
Flyway
.configure()
.dataSource(url, user, password)
.locations("classpath:db/migration")
.baselineOnMigrate(true)