Adjusted flyway logging
This commit is contained in:
parent
d70238d3e0
commit
d27d37c4db
@ -71,17 +71,28 @@ class FlywayAutoConfig(
|
||||
.load()
|
||||
|
||||
val pending = flyway.info().pending()
|
||||
if (pending.isEmpty()) {
|
||||
log.info("⚠️ No pending Flyway migrations found in ${locations.joinToString()}")
|
||||
} else {
|
||||
log.info("📦 Pending migrations: ${pending.joinToString { it.script }}")
|
||||
|
||||
when {
|
||||
pending.isEmpty() -> {
|
||||
log.info("ℹ️ Flyway is up to date. No migrations to apply.")
|
||||
}
|
||||
|
||||
flyway.migrate()
|
||||
log.info("✅ Flyway migration complete.")
|
||||
else -> {
|
||||
log.info("📦 Pending migrations: ${pending.joinToString { it.script }}")
|
||||
}
|
||||
}
|
||||
|
||||
val result = flyway.migrate()
|
||||
|
||||
if (result.migrationsExecuted > 0) {
|
||||
log.info("✅ Applied ${result.migrationsExecuted} migration(s).")
|
||||
} else {
|
||||
log.info("ℹ️ No migrations were applied.")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ConfigurationProperties(prefix = "spring.flyway")
|
||||
data class FlywayProperties(
|
||||
var locations: List<String> = emptyList()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user