Upgrading posts to new data structure

This commit is contained in:
2018-10-29 08:12:34 +09:00
parent 84f650a636
commit 681177b28e
4 changed files with 26 additions and 5 deletions

View File

@ -0,0 +1,20 @@
package main
import (
"github.com/animenotifier/arn"
"github.com/fatih/color"
)
func main() {
color.Yellow("Updating post structure")
defer color.Green("Finished.")
defer arn.Node.Close()
// Iterate over the stream
for post := range arn.StreamPosts() {
post.ParentID = post.ThreadID
post.ParentType = "Thread"
post.Save()
}
}