Prisma "prisma db seed" command failed in CI
prisma db seed runs the seed command you declare in package.json. It fails in CI when the seed script itself throws (bad data, missing tables) or when no seed command is configured for Prisma to run.
What this error means
A seed step fails with "The seed command is not configured..." or with the seed script's own error such as a unique-constraint violation, after which the run stops.
Prisma
Error: The seed command is not configured. Please add the following to your package.json:
"prisma": { "seed": "ts-node prisma/seed.ts" }Common causes
No seed command declared
Prisma looks for prisma.seed in package.json; without it, db seed has nothing to run.
The seed script errors against the schema
Seeding before migrations, or inserting duplicate keys, makes the seed script throw and fail the step.
How to fix it
Declare the seed command
Add the prisma.seed entry so prisma db seed knows what to execute.
package.json
{
"prisma": {
"seed": "ts-node prisma/seed.ts"
}
}Seed after migrations, idempotently
- Run migrate deploy (or db push) before seeding so tables exist.
- Make the seed script idempotent (upsert) so re-runs do not violate constraints.
- Run
prisma db seedafter the schema is in place.
Terminal
npx prisma migrate deploy
npx prisma db seedHow to prevent it
- Declare the seed command in package.json under
prisma.seed. - Seed only after the schema exists in CI.
- Write idempotent seeds so repeated CI runs succeed.
Related guides
Prisma "prisma db push" schema sync fails in CIFix "prisma db push" failures in CI - the command force-syncs schema.prisma to the database and can warn abou…
Prisma "relation does not exist" (migrate before querying) in CIFix Postgres "relation \"X\" does not exist" through Prisma in CI - the tests query a table before migrations…
Prisma "Error validating" in schema.prisma in CIFix "Error validating" in schema.prisma in CI - Prisma parses and validates the schema before any command run…