debugprismaModerate
Prisma client not reflecting schema changes after migration
Viewed 0 times
prisma generateschema changesclient outdatedtypes wrongmigrate deploynode_modules/.prisma
nodejsci-cd
Error Messages
Problem
After updating schema.prisma and running migrations, the Prisma client still shows old types and fields. TypeScript autocomplete does not include new columns. Queries on new fields fail at runtime.
Solution
You must regenerate the Prisma client after schema changes: npx prisma generate. This is separate from npx prisma migrate dev (which creates the migration SQL). The typical workflow is: (1) Edit schema.prisma, (2) npx prisma migrate dev --name description, (3) npx prisma generate. Note: prisma migrate dev runs generate automatically, but prisma migrate deploy (production) does NOT. In CI/CD, always run prisma generate after prisma migrate deploy. Also restart your TypeScript server (VS Code: Cmd+Shift+P > Restart TS Server) to pick up new types.
Why
The Prisma client is a generated library in node_modules/.prisma/client. It is a static artifact that must be regenerated to match schema changes. The migration only modifies the database, not the client.
Revisions (0)
No revisions yet.