Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

70
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!