Adding a bunch of dummy comments on each post
This commit is contained in:
parent
d12bd9aa99
commit
3d40ec513e
1 changed files with 13 additions and 0 deletions
|
@ -105,6 +105,19 @@ async fn lipsum_setup(pool: &PgPool) -> Result<(), sqlx::Error> {
|
|||
.execute(pool)
|
||||
.await?;
|
||||
}
|
||||
|
||||
// Insert a bunch of comments
|
||||
for i in 1..101 {
|
||||
for _ in 0..rng.gen_range(3..30) {
|
||||
query!(
|
||||
"INSERT INTO comments (author_user_id, parent_post_id, content) VALUES (1, $1, $2)",
|
||||
i,
|
||||
lipsum(rng.gen_range(10..100))
|
||||
)
|
||||
.execute(pool)
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in a new issue