after prisma db pull and prisma generate. When I d...
# orm-help
p
after prisma db pull and prisma generate. When I do
prisma.user.create({ ... })
it gives me
Property 'id' is missing in type
error.
Copy code
model User {
  email        String    @unique
  password     String?
  roles        Role[]
  tokenVersion Int       @default(0)
  username     String
  createdAt    DateTime  @default(now())
  updatedAt    DateTime  @default(now())
  deletedAt    DateTime?
  provider     String?
  providerId   String?
  id           String    @id

  @@unique([provider, providerId])
}
n
Hey 👋 What database and prisma version are you using? I just tried out the user model that you mentioned, pushed it to the database and then tried introspecting it and this is the model that was obtained:
Copy code
model User {
  email        String    @unique
  password     String?
  tokenVersion Int       @default(0)
  username     String
  createdAt    DateTime  @default(now())
  updatedAt    DateTime  @default(now())
  deletedAt    DateTime?
  provider     String?
  providerId   String?
  id           String    @id @default(cuid())
  roles        Role[]

  @@unique([provider, providerId])
}
It had the
@default(cuid())
in id field as expected.