> For the complete documentation index, see [llms.txt](https://docs.petal.build/petal-pro-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.petal.build/petal-pro-documentation/product-docs/fundamentals/seeding.md).

# Seeding

In `seeds.ex` we create an admin user and an arbitrary number of random users:

```elixir
alias PetalPro.Accounts.User
alias PetalPro.Accounts.UserToken
alias PetalPro.Logs.Log
alias PetalPro.Accounts.UserSeeder

if Mix.env() == :dev do
  PetalPro.Repo.delete_all(Log)
  PetalPro.Repo.delete_all(UserToken)
  PetalPro.Repo.delete_all(User)

  UserSeeder.admin()
  UserSeeder.random_users(20)
end
```

We use the faker library for randomizing data:

```elixir
def random_user_attributes(attrs \\ %{}) do
  Enum.into(attrs, %{
    name: Faker.Person.En.first_name() <> " " <> Faker.Person.En.last_name(),
    email: unique_user_email()
  })
end
```

Seeds should be regularly updated with any new tables you create. This allows you to better test and develop your app.
