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

68
Vistas
Prisma ORM relation

Trying to figure out how to make this relation between two tables by doing a lookup on second table.

model Person {
  personId                 String                     @id @default(uuid())
  address                  String                     @unique
  displayName              String?                    @unique
  emailAddress             String
  allow                    Allow[]
}

model Allow {
  allowId    String   @id @default(uuid())
  address    String
  createdAt  DateTime @default(now())
  updatedAt  DateTime @updatedAt
  profile    Profile  @relation(fields: [address], references: [address])

  @@unique([allowId, address])
}

I'm trying to return a Person object with a property of 'canAllow' which basically pulls back all the data for a Person with another property of 'canAllow' which gets set by checking if there is a matching address in the Allow table.

about 4 years ago · Juan Pablo Isaza
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