gorm升级到v2版本

This commit is contained in:
linwenxiang committed 2020-08-27 11:17:15 +08:00
1 parent 93cfe443d6
commit 60c7496f7b
56 files changed
+630 -477

No files matched your search

+2
View File
@@ -4,6 +4,7 @@ import (
"fmt"
"go-admin/global"
"io/ioutil"
"log"
"strings"
)
@@ -32,6 +33,7 @@ func ExecSql(filePath string) error {
sql := strings.Replace(sqlList[i]+";", "\n", "", 0)
sql = strings.TrimSpace(sql)
if err = global.Eloquent.Exec(sql).Error; err != nil {
log.Printf("error sql: %s", sql)
if !strings.Contains(err.Error(), "Query was empty") {
return err
}