Search⌘ K
AI Features

Seeds

Explore how to create and run seed files in AdonisJs to populate database tables. This lesson guides you through adding sample records to your products table using seed classes, running migrations with seeds, and updating seed data efficiently to prepare your application database.

We'll cover the following...

Seeds are used to populate the tables that we created using migrations, with data.

Creating a seed

Let’s create a seed to add a few records to our products table that we created earlier. After the database is seeded, the table should look something like this:

id name
...