Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

197
Vistas
Some Prisma Model @@map not generating

I have a few models in my schema.prisma file that are not generating with their @@map for use in the client.

model ContentFilter {
  id                Int           @id @default(autoincrement())
  blurriness        Float?        @default(0.3)
  adult             Float?        @default(0.5)
  medical           Float?        @default(0.8)
  violence          Float?        @default(0.5)
  racy              Float?        @default(0.5)
  party_settings_id Int           @unique
  party_settings    PartySettings @relation(fields: [party_settings_id], references: [id])

  @@map("contentfilter")
}

model PartySettings {
  id                 Int            @id @default(autoincrement())
  start              DateTime?      @default(now())
  end                DateTime?      @default(now())
  require_location   Boolean?       @default(false)
  require_name       Boolean?       @default(true)
  allow_comments     Boolean?       @default(true)
  allow_likes        Boolean?       @default(true)
  allow_before_party Boolean?       @default(false)
  party_id           Int            @unique
  party              Party          @relation(fields: [party_id], references: [id])
  content_filter     ContentFilter?

  @@map("partysettings")
}

model Party {
  id          Int            @id @default(autoincrement())
  name        String
  hash        String         @unique
  description String
  user_id     Int
  user        User           @relation(fields: [user_id], references: [id])
  images      Image[]
  order       Order?
  settings    PartySettings?

  @@map("party")
}

the rest of my models are available in the client by referencing them with prisma.mappedname such as prisma.party (from the example above) that table is exposed and available within the client. But both the partysettings and contentfilter is not avialable. I've ran the migrate and generate commands many times as well as deleted my database and reran migrate and generate. Could anyone help me understand what i'm doing so different in these two tables?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

@@map operator is used to declare the table name in the database, it doesn't affect the model names that are generated via PrismaClient.

So as per your schema file, the name of the tables in your database would be party, contentfilter and partysettings.

By default the name of the property is the lowercase form of the model name, e.g. user for a User model or post for a Post model.

Map attribute: Reference

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda