Deduplicate logic across controllers, auth, and schema fixes
All checks were successful
build-and-deploy / build-deploy (push) Successful in 33s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 33s
This commit is contained in:
@@ -1,24 +1,14 @@
|
||||
package com.android.trisolarisserver.config
|
||||
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.springframework.boot.ApplicationArguments
|
||||
import org.springframework.boot.ApplicationRunner
|
||||
import org.springframework.jdbc.core.JdbcTemplate
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class RoomImageSchemaFix(
|
||||
private val jdbcTemplate: JdbcTemplate
|
||||
) : ApplicationRunner {
|
||||
|
||||
private val logger = LoggerFactory.getLogger(RoomImageSchemaFix::class.java)
|
||||
|
||||
override fun run(args: ApplicationArguments) {
|
||||
val version = jdbcTemplate.queryForObject("select version()", String::class.java) ?: return
|
||||
if (!version.contains("PostgreSQL", ignoreCase = true)) {
|
||||
return
|
||||
}
|
||||
) : PostgresSchemaFix(jdbcTemplate) {
|
||||
|
||||
override fun runPostgres(jdbcTemplate: JdbcTemplate) {
|
||||
val hasContentHash = jdbcTemplate.queryForObject(
|
||||
"""
|
||||
select count(*)
|
||||
|
||||
Reference in New Issue
Block a user