Prisma Not Showing All Columns After Migration? Here’s What Fixed It for Me

Build Logs & Projects\\Apr 22, 2025

Quick one today! Just something I ran into on a client project that wasted 15 minutes of my time, and figured sharing it might save someone else a bit of head-scratching.

I’d set up the initial Prisma schema, ran prisma migrate dev to create the tables, and then used prisma generate as usual. Everything was working fine. Later, I needed to add a few more columns to the same table, so I updated the schema, ran another migration, ran generate again, and… nothing.

Back in my Next.js app, those new fields just weren’t showing up. Not in autocompletion, not in query results. I restarted the TypeScript server, cleared cache, ran generate again. Still no sign of the new columns.

The Fix (Not Fancy, But It Worked)

Turns out, Prisma’s generate process doesn’t always refresh properly. What finally worked:

1. Manually delete the /app/generated/prisma folder

rm -rf /app/generated/prisma  # or wherever your output is configured

2. Re-run the generate command

npx prisma generate

Boom — the new columns were now available in my queries and types.

Why This Happens (I Think)

I don’t have a deep internal explanation, but it looks like Prisma’s generate sometimes skips re-generating when it doesn’t detect changes correctly — especially if you’re mid-session in VS Code and already have types loaded. Clearing the generated folder forces it to start fresh.

Also, restarting the TypeScript server doesn’t help if the underlying type files were never updated in the first place.

Just In Case You’re Doing This Too…

If you’re:

  • Adding new columns to a model
  • Running migrations that succeed
  • Seeing the correct schema in your DB
  • But your code isn’t picking up the new fields

…try deleting the generated folder manually and regenerating. It’s a small thing, but a frustrating one when it happens.

Get In Touch

Have a question or just want to say hi? I'd love to hear from you.

Use this form to send me a message, and I aim to respond within 24 hours.

Stay in the loop

Get a weekly update on everything I'm building with AI and automation — no spam, just real stuff.

Goes out once a week. Easy unsubscribe. No fluff.
© 2025All rights reserved
MohitAneja.com