Using Prisma with Postgres, is it possible to enfo...
# orm-help
j
Using Prisma with Postgres, is it possible to enforce that a foreign key is one of multiple types?
Copy code
model Vote {
  id         String        @id
  type       [ThingA | ThingB] // A vote must be exactly one of these 2
  created_at DateTime      @default(now())
  updated_at DateTime      @updatedAt
}
r
Hey @James Fox 👋 This currently isn't possible with Prisma. How would it be if it were to be implemented with raw sql?