mirror of
https://github.com/go-gitea/gitea
synced 2025-11-01 11:58:25 +00:00
@@ -45,7 +45,7 @@ func CheckConsistencyFor(t TestingT, beansToCheck ...any) {
|
||||
}
|
||||
|
||||
func checkForConsistency(t TestingT, bean any) {
|
||||
tb, err := db.TableInfo(bean)
|
||||
tb, err := GetXORMEngine().TableInfo(bean)
|
||||
assert.NoError(t, err)
|
||||
f := consistencyCheckMap[tb.Name]
|
||||
require.NotNil(t, f, "unknown bean type: %#v", bean)
|
||||
|
||||
@@ -218,7 +218,7 @@ func NewFixturesLoader(x *xorm.Engine, opts FixturesOptions) (FixturesLoader, er
|
||||
xormBeans, _ := db.NamesToBean()
|
||||
f.xormTableNames = map[string]bool{}
|
||||
for _, bean := range xormBeans {
|
||||
f.xormTableNames[db.TableName(bean)] = true
|
||||
f.xormTableNames[x.TableName(bean)] = true
|
||||
}
|
||||
|
||||
return f, nil
|
||||
|
||||
@@ -159,7 +159,7 @@ func DumpQueryResult(t require.TestingT, sqlOrBean any, sqlArgs ...any) {
|
||||
goDB := x.DB().DB
|
||||
sql, ok := sqlOrBean.(string)
|
||||
if !ok {
|
||||
sql = "SELECT * FROM " + db.TableName(sqlOrBean)
|
||||
sql = "SELECT * FROM " + x.TableName(sqlOrBean)
|
||||
} else if !strings.Contains(sql, " ") {
|
||||
sql = "SELECT * FROM " + sql
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user