Avatar struct patch

This commit is contained in:
2017-07-17 19:49:52 +02:00
parent 98519b7b02
commit 98c4b90e9f
5 changed files with 44 additions and 3 deletions

View File

@ -0,0 +1,24 @@
package main
import (
"github.com/animenotifier/arn"
"github.com/fatih/color"
"github.com/jinzhu/copier"
)
func main() {
color.Yellow("Updating user struct")
// Iterate over the stream
for user := range arn.MustStreamUsers() {
newUser := &arn.UserNew{}
copier.Copy(newUser, user)
newUser.Avatar.Extension = user.Avatar
// Save in DB
arn.PanicOnError(arn.DB.Set("User", user.ID, newUser))
}
color.Green("Finished.")
}