调整log代码,兼容zap扩展支持fields
This commit is contained in:
1 parent
39dd1ee6f8
commit
75711922b4
47 files changed
+267
-275
No files matched your search
@@ -2,18 +2,17 @@ package models
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go-admin/tools/app"
|
||||
"gorm.io/gorm"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"go-admin/common/global"
|
||||
)
|
||||
|
||||
func InitDb(db *gorm.DB) (err error) {
|
||||
filePath := "config/db.sql"
|
||||
err = ExecSql(db, filePath)
|
||||
if global.Driver == "postgres" {
|
||||
if app.Driver == "postgres" {
|
||||
filePath = "config/pg.sql"
|
||||
err = ExecSql(db, filePath)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user