Skip to content

Commit

Permalink
Remove deprecated db config keys
Browse files Browse the repository at this point in the history
  • Loading branch information
NovaFox161 committed Sep 3, 2023
1 parent 82978ad commit 7e7f47a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ enum class Config(private val key: String, private var value: Any? = null) {
// Basic spring settings
APP_NAME("spring.application.name"),

// Database settings, to be removed once DatabaseManager is retired
SQL_URL("spring.r2dbc.url"),
SQL_USERNAME("spring.r2dbc.username"),
SQL_PASSWORD("spring.r2dbc.password"),

// Redis cache settings
REDIS_HOST("spring.data.redis.host"),
REDIS_PORT("spring.data.redis.port"),
Expand Down Expand Up @@ -60,24 +65,6 @@ enum class Config(private val key: String, private var value: Any? = null) {

INTEGRATIONS_UPDATE_BOT_LIST_SITES("bot.integrations.update-bot-sites", false),

// Legacy -- All the below should be deprecated and ultimated removed
@Deprecated("Use Spring Data")
SQL_HOST("SQL_HOST"),

@Deprecated("Use Spring Data")
SQL_PORT("SQL_PORT"),

@Deprecated("Use Spring Data")
SQL_USER("SQL_USER"),

@Deprecated("Use Spring Data")
SQL_PASS("SQL_PASS"),

@Deprecated("Use Spring Data")
SQL_DB("SQL_DB"),

@Deprecated("Use Spring Data")
SQL_PREFIX("SQL_PREFIX"),

;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ object DatabaseManager {
builder()
.option(DRIVER, "pool")
.option(PROTOCOL, "mysql")
.option(HOST, Config.SQL_HOST.getString())
.option(PORT, Config.SQL_PORT.getInt())
.option(USER, Config.SQL_USER.getString())
.option(PASSWORD, Config.SQL_PASS.getString())
.option(DATABASE, Config.SQL_DB.getString())
.from(parse(Config.SQL_URL.getString()))
.option(USER, Config.SQL_USERNAME.getString())
.option(PASSWORD, Config.SQL_PASSWORD.getString())
.build()
)

Expand Down

0 comments on commit 7e7f47a

Please sign in to comment.