[HELP] Prisma model field not appearing in generated client (refresh_token missing)

Hi everyone, I've been stuck for 5 days and really need help. I'm using Prisma + NestJS + PostgreSQL on macOS. I added a refresh_token field to my User model in schema.prisma, like this: model User { id String @id @default(uuid()) username String @unique phone String @unique email String @unique passwordHash String refresh_token String? // <-- this is the field createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } After I added this, I ran: npx prisma migrate dev --name add-refresh-token It shows the migration runs successfully. But when I try to access user.refresh_token in my NestJS service, I get this TS error: Property 'refresh_token' does not exist on type 'User'. And Prisma throws errors like: Object literal may only specify known properties, and 'refresh_token' does not exist in type 'UserSelect<DefaultArgs>'. I’ve already tried: * Dropping and recreating the database manually with psql * Running npx prisma generate * Deleting node_modules, .prisma, and rebuilding the whole backend * Running prisma migrate reset, db pull, etc. But nothing works — the refresh_token field just doesn't appear in the generated client type. Here’s my environment: * macOS M4 chip * Node.js 18.18.2 * Prisma 6.6.0 * PostgreSQL 14.17 (via Homebrew) What else can I try? Is this a bug or am I missing something critical? Thanks so much!
3 Replies
Prisma AI Help
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into #ask-ai for a quick spin!
Nurul
Nurul5d ago
Hey! Just to confirm, when you run npx prisma studio command, do you see the refresh_token column in User table?
hanholy21
hanholy21OP5d ago
Thank you very much for your reply and help. When I ran npx Prisma Studio, I saw refresh_token, but still received an error message. I am unable to even start the backend now. This is really uncomfortable😭
No description
No description

Did you find this page helpful?