minimize seeds count

This commit is contained in:
Yanislav Igonin 2021-09-04 21:46:56 +03:00
parent 41675a63fc
commit cc5ded555a

View File

@ -75,7 +75,7 @@ func seedLocal() {
func seedDb() { func seedDb() {
// preparing seed data with parent posts with files // preparing seed data with parent posts with files
var parentPosts []Post var parentPosts []Post
for i := 1; i < 100; i++ { for i := 1; i < 10; i++ {
post := getPost(i, nil) post := getPost(i, nil)
parentPosts = append(parentPosts, post) parentPosts = append(parentPosts, post)
} }
@ -97,7 +97,7 @@ func seedDb() {
} }
// making child posts // making child posts
for i := 0; i < 100; i++ { for i := 0; i < 10; i++ {
// getting child post with files // getting child post with files
childPost := getPost(0, &parentPostID) childPost := getPost(0, &parentPostID)
childPostID, err := Posts.Create(childPost) childPostID, err := Posts.Create(childPost)