Prisma Schema Changes Require Three Steps: Migrate, Generate, and Restart
A developer debugging a Next.js app discovered that a valid database row was missing at runtime despite correct SQL joins and a compiling repository. The root cause was an incomplete Prisma schema update workflow: while the database migration and TypeScript client regeneration had been run, the Next.js development server had not been restarted. Because Node.js is a long-running process, it held onto the stale generated Prisma client in memory, unlike PHP which reloads code fresh on each request. This highlights a key mental-model shift for developers coming from request-scoped frameworks. The takeaway is a clear debugging rule: any Prisma model change must be followed by migrate, generate, and a full server restart before investigating query logic.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in