Adding a bunch of dummy comments on each post

This commit is contained in:
Imbus 2024-03-06 08:03:03 +01:00
parent d12bd9aa99
commit 3d40ec513e

View file

@ -105,6 +105,19 @@ async fn lipsum_setup(pool: &PgPool) -> Result<(), sqlx::Error> {
.execute(pool) .execute(pool)
.await?; .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(()) Ok(())