🐛 fix(ability, channel): standardize boolean value handling across database queries

This commit is contained in:
CaIon
2025-06-14 18:15:45 +08:00
parent b9b4b24961
commit d57e6425e5
3 changed files with 13 additions and 15 deletions

View File

@@ -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"`