Before running the command, ensure you have configured your project to support seeding: 
  1. Define the seed script location In your package.json file, you must specify the command to run your seed script. This command should be located under the prisma property.
    json
    "prisma": {
      "seed": "ts-node prisma/seed.ts"
      // or "node prisma/seed.js" if you are using JavaScript
    }
    
  2. Create the seed file Create the actual script in the location specified above (e.g., prisma/seed.ts). This script uses Prisma Client to write data to your database.
  3. Run the command Open your terminal and execute:
    bash
    npx prisma db seed
    

     

This command will execute the script defined in your package.json, populating your database with the necessary sample data