feat:兼容数据库类型大小写

pull/358/head
lifei6671 2018-08-10 17:59:34 +08:00
parent 4702115a9c
commit b50d39f690
1 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ func RegisterDataBase() {
beego.Info("正在初始化数据库配置.")
adapter := beego.AppConfig.String("db_adapter")
if adapter == "mysql" {
if strings.EqualFold(adapter, "mysql") {
host := beego.AppConfig.String("db_host")
database := beego.AppConfig.String("db_database")
username := beego.AppConfig.String("db_username")
@ -54,7 +54,7 @@ func RegisterDataBase() {
beego.Error("注册默认数据库失败->", err)
os.Exit(1)
}
} else if adapter == "sqlite3" {
} else if strings.EqualFold(adapter, "sqlite3") {
orm.DefaultTimeLoc = time.UTC
database := beego.AppConfig.String("db_database")
if strings.HasPrefix(database, "./") {