mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-04-19 07:17:26 +00:00
🐛 fix(ability, channel): standardize boolean value handling across database queries
This commit is contained in:
@@ -18,6 +18,8 @@ import (
|
||||
|
||||
var commonGroupCol string
|
||||
var commonKeyCol string
|
||||
var commonTrueVal string
|
||||
var commonFalseVal string
|
||||
|
||||
var logKeyCol string
|
||||
var logGroupCol string
|
||||
@@ -27,11 +29,15 @@ func initCol() {
|
||||
if common.UsingPostgreSQL {
|
||||
commonGroupCol = `"group"`
|
||||
commonKeyCol = `"key"`
|
||||
commonTrueVal = "true"
|
||||
commonFalseVal = "false"
|
||||
} else {
|
||||
commonGroupCol = "`group`"
|
||||
commonKeyCol = "`key`"
|
||||
commonTrueVal = "1"
|
||||
commonFalseVal = "0"
|
||||
}
|
||||
if DB != LOG_DB {
|
||||
if os.Getenv("LOG_SQL_DSN") != "" {
|
||||
switch common.LogSqlType {
|
||||
case common.DatabaseTypePostgreSQL:
|
||||
logGroupCol = `"group"`
|
||||
|
||||
Reference in New Issue
Block a user