|
@ -5,6 +5,8 @@ import ( |
|
|
"gorm.io/gorm" |
|
|
"gorm.io/gorm" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
const system = "system" |
|
|
|
|
|
|
|
|
func DBList() { |
|
|
func DBList() { |
|
|
dbMap := make(map[string]*gorm.DB) |
|
|
dbMap := make(map[string]*gorm.DB) |
|
|
for _, info := range global.GVA_CONFIG.DBList { |
|
|
for _, info := range global.GVA_CONFIG.DBList { |
|
@ -20,5 +22,10 @@ func DBList() { |
|
|
continue |
|
|
continue |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
// 做特殊判断,是否有迁移
|
|
|
|
|
|
// 适配低版本迁移多数据库版本
|
|
|
|
|
|
if sysDB, ok := dbMap[system]; ok { |
|
|
|
|
|
global.GVA_DB = sysDB |
|
|
|
|
|
} |
|
|
global.GVA_DBList = dbMap |
|
|
global.GVA_DBList = dbMap |
|
|
} |
|
|
} |