Skip to content

Commit

Permalink
fix: try to fix pgsql #682
Browse files Browse the repository at this point in the history
  • Loading branch information
Calcium-Ion committed Dec 30, 2024
1 parent b4f1754 commit 87d5e28
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion model/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
var groupCol string
var keyCol string

func init() {
func initCol() {
if common.UsingPostgreSQL {
groupCol = `"group"`
keyCol = `"key"`
Expand Down Expand Up @@ -55,6 +55,9 @@ func createRootAccountIfNeed() error {
}

func chooseDB(envName string) (*gorm.DB, error) {
defer func() {
initCol()
}()
dsn := os.Getenv(envName)
if dsn != "" {
if strings.HasPrefix(dsn, "postgres://") {
Expand Down

0 comments on commit 87d5e28

Please sign in to comment.