123
This commit is contained in:
parent
37f9a93d3b
commit
1c29af53b3
@ -51,7 +51,7 @@ func InitDB(env string, conf DbConfig) {
|
||||
if conf.Charset == "" {
|
||||
conf.Charset = "utf8mb4"
|
||||
}
|
||||
dsn := fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=%s&parseTime=True&loc=Local",
|
||||
dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=%s&parseTime=True&loc=Local",
|
||||
conf.User, conf.Password, conf.Host, conf.Port, conf.Database, conf.Charset)
|
||||
if env == "dev" {
|
||||
db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user