Development setup
Populate a newly created development database with baseline records.
Prisma · Command
prisma db seed runs the command configured in migrations.seed to populate a database with initial or test data. In Prisma ORM v7, it must be invoked explicitly.
The command executes the seed command configured under migrations.seed in prisma.config.ts. In Prisma ORM v7, seeding is explicit, so running this command is what invokes the configured script.
prisma db seed [options]| Name | Type | Description |
|---|---|---|
options | CLI options | Optional Prisma CLI flags, including --help and --config. |
seed arguments | command-line arguments | Arguments forwarded to the configured seed command after --. |
Runs the configured seed command and exits with that command's status.
npx prisma db seedRuns the seed command configured in the migrations.seed field of prisma.config.ts.
Populate a newly created development database with baseline records.
Create predictable records before automated tests run.
Forward environment-specific values to the seed script.
It runs the command stored in the seed property of the migrations object in prisma.config.ts. That configured command can invoke a JavaScript or TypeScript seed script.
Follow-up: How do you pass arguments to the seed script? Put them after the -- delimiter, for example prisma db seed -- --environment test.
In Prisma ORM v7, this command is the explicit trigger for database seeding. Migration commands no longer invoke seeding automatically.
Follow-up: What changed from Prisma ORM v6? Automatic seeding after prisma migrate dev or prisma migrate reset was removed in v7.
The command supports help, a custom Prisma config path through --config, and arguments forwarded to the seed command after --. The basic form is prisma db seed [options].
Follow-up: How can you use a non-default configuration file? Supply its path with the --config option.
prisma.config.tsmigrations.seedprisma migrate devprisma migrate reset--skip-seed