forked from mirror/gorm
Fix preload fmt.Errorf formatter (#4531)
This commit is contained in:
parent
2202e99cbf
commit
5115813c50
|
@ -209,7 +209,7 @@ func Preload(db *gorm.DB) {
|
||||||
if rel := db.Statement.Schema.Relationships.Relations[name]; rel != nil {
|
if rel := db.Statement.Schema.Relationships.Relations[name]; rel != nil {
|
||||||
preload(db, rel, db.Statement.Preloads[name], preloadMap[name])
|
preload(db, rel, db.Statement.Preloads[name], preloadMap[name])
|
||||||
} else {
|
} else {
|
||||||
db.AddError(fmt.Errorf("%v: %w for schema %v", name, gorm.ErrUnsupportedRelation, db.Statement.Schema.Name))
|
db.AddError(fmt.Errorf("%s: %w for schema %s", name, gorm.ErrUnsupportedRelation, db.Statement.Schema.Name))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -616,7 +616,7 @@ func (m Migrator) CreateIndex(value interface{}, name string) error {
|
||||||
return m.DB.Exec(createIndexSQL, values...).Error
|
return m.DB.Exec(createIndexSQL, values...).Error
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Errorf("failed to create index with name %v", name)
|
return fmt.Errorf("failed to create index with name %s", name)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue