#Unknown field for select statement on model

4 messages · Page 1 of 1 (latest)

heavy flower
#

After adding the field named slug to a findFirst() select object I get 'Unknown field slug for select statement om model mymodel':

db.mymodel.findFirst({
  select: {
    ...
    slug: true,
})

The thing is that slug is there in schema.prisma, after running prisma migrate migrations for it were created. Also, I verified that the column is there in the database.

But obviously some place is still left to go to... In short I want to add to add a field/column to an existing model, and include it in a query like the one above. Is there an obvious solution? Or is there a good page about this somewhere?

I'm new to this so if possible simpler language is easier, but I'll of course do what I can to read up on what's needed.

heavy flower
#

Checked that both @prisma/client and prisma packages are at 5.9.0

young bay
#

Hey @heavy flower 👋
Did you invoke npx prisma generate command after adding slug column in your model is schema.prisma file?

heavy flower