Skip to content

Commit

Permalink
Merge pull request #1091 from songzhibin97/fix-db-list-alias-name
Browse files Browse the repository at this point in the history
fix:alias name repetition
  • Loading branch information
songzhibin97 authored May 26, 2022
2 parents afaca23 + fe59002 commit 4726ba0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion server/config/db_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ type GeneralDB struct {
Path string `mapstructure:"path" json:"path" yaml:"path"` // 服务器地址:端口
Port string `mapstructure:"port" json:"port" yaml:"port"` //:端口
Config string `mapstructure:"config" json:"config" yaml:"config"` // 高级配置
AliasName string `mapstructure:"alias-name" json:"alias-name" yaml:"alias-name"` // 在多数据库中 生效
Dbname string `mapstructure:"db-name" json:"db-name" yaml:"db-name"` // 数据库名
Username string `mapstructure:"username" json:"username" yaml:"username"` // 数据库用户名
Password string `mapstructure:"password" json:"password" yaml:"password"` // 数据库密码
Expand Down
4 changes: 2 additions & 2 deletions server/initialize/db_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ func DBList() {
}
switch info.Type {
case "mysql":
dbMap[info.GeneralDB.AliasName] = GormMysqlByConfig(config.Mysql{GeneralDB: info.GeneralDB})
dbMap[info.AliasName] = GormMysqlByConfig(config.Mysql{GeneralDB: info.GeneralDB})
case "pgsql":
dbMap[info.GeneralDB.AliasName] = GormPgSqlByConfig(config.Pgsql{GeneralDB: info.GeneralDB})
dbMap[info.AliasName] = GormPgSqlByConfig(config.Pgsql{GeneralDB: info.GeneralDB})
default:
continue
}
Expand Down

0 comments on commit 4726ba0

Please sign in to comment.