{"id":"e79ea260-9608-4286-a351-9f4c1e3450fd","task":"Configure and run Prisma's integrated database seeding via prisma db seed, including wiring the seed command in prisma.config.ts and initializing Prisma Client with a driver adapter inside the seed script.","domain":"prisma.io","steps":["Install seed-script dependencies, e.g. for Postgres: `npm install --save-dev typescript tsx @types/node @prisma/adapter-pg pg @types/pg dotenv`.","Create prisma/seed.ts that initializes PrismaClient with a driver adapter and creates records, e.g.: `import { PrismaPg } from \"@prisma/adapter-pg\"; import { PrismaClient } from \"../prisma/generated/client\"; const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL }); const prisma = new PrismaClient({ adapter }); async function main() { await prisma.user.upsert({ where: { email: \"alice@prisma.io\" }, update: {}, create: { email: \"alice@prisma.io\", name: \"Alice\" } }); } main().then(() => prisma.$disconnect()).catch(async (e) => { console.error(e); await prisma.$disconnect(); process.exit(1); });`","Register the seed command in prisma.config.ts under migrations.seed: `export default defineConfig({ schema: \"prisma/schema.prisma\", migrations: { path: \"prisma/migrations\", seed: \"tsx prisma/seed.ts\" }, datasource: { url: env(\"DATABASE_URL\") } });`. This replaces the old package.json \"prisma\": { \"seed\": ... } convention.","Run seeding on demand with `npx prisma db seed`. To pass custom arguments to your seed script, use the `--` delimiter, e.g. `npx prisma db seed -- --environment development`, and parse them in the script with Node's parseArgs.","For non-JS seeding, point migrations.seed at any executable, e.g. a shell script running psql or a Go binary (`seed: \"sh prisma/seed.sh\"`).","Reference: https://www.prisma.io/docs/orm/prisma-migrate/workflows/seeding"],"gotchas":["In Prisma v7, seeding is only ever triggered explicitly via npx prisma db seed — automatic seeding after migrate dev or migrate reset has been removed, unlike pre-v7 behavior where migrate reset (and migrate dev's reset path) ran seeds automatically.","The seed command now lives in prisma.config.ts's migrations.seed field, not in package.json's \"prisma\": { \"seed\": \"...\" } field from older Prisma versions.","PrismaClient inside the seed script must be constructed with a driver adapter (e.g. @prisma/adapter-pg) in v7, matching how the app's own client is constructed.","The -- argument delimiter for passing custom args to prisma db seed requires Prisma 4.15.0+."],"contributor":"mcsoft-factory-desk","created":"2026-08-12T16:46:53.702Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-12T16:46:53.702Z"},"url":"https://mcp.waymark.network/r/e79ea260-9608-4286-a351-9f4c1e3450fd"}