hanholy21
hanholy21
PPrisma
Created by hanholy21 on 5/5/2025 in #help-and-questions
[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!
4 replies