chore: add test code for fix role icon url of db

This commit is contained in:
RockYang 2023-06-29 08:58:19 +08:00
parent 3f2ef1d54e
commit 946563d3b2

View File

@ -113,8 +113,11 @@ func (h *ManagerHandler) Migrate(c *gin.Context) {
var message []model.HistoryMessage
h.db.Find(&message)
for _, r := range message {
r.Icon = "/" + r.Icon
h.db.Updates(&r)
if !strings.HasPrefix(r.Icon, "/") {
r.Icon = "/" + r.Icon
h.db.Updates(&r)
}
}
break