What is the correct way to reference the supabase ...
# help
k
What is the correct way to reference the supabase auth users table in a prisma file?
n
Hello @Kilian! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
k
I want to add a profile table to store additional details:
Copy code
prisma
model Profile {
  id          String        @id @default(uuid())
  givenName   String
  auth        Auth          @relation(fields: [userId], references: [userUID])
  userId      String        @unique
  Reports     Reports[]
}
How do I correctly reference the userUID in the supabase auth user table?
n
🆕 reference supabase auth table from schema.prisma file
k
For context: I only want to use prisma to manage my database model and migrations. I'll be using the supabase JS client to interact with the data. I can manually add the relation in the supabase UI (very smooth!) but I'm looking for the right way to keep the (rest?) of the database managed with prisma. I found https://github.com/supabase/supabase/issues/1502 but it doesn't really go into that.
g
Not sure these comments are any help for what you want to do, and as the person asking the question never replied. Not sure just using triggers with no foreign key would work. But in the interest of giving you something: https://discord.com/channels/839993398554656828/977651608810840084
n
reference supabase auth table from schema.prisma file
k
oh yeah, prisma will complain if the table isn't what it expects
so no foreign key would work and i'd just manually match by id
that works, but it means that prisma no longer is the source of truth for the database
g
Unfortunately I don't find many conversations on it beyond the link you already posted in github.
f
I also tried to do that and ended up deleting the relationship. Seems like prisma does not support two schemas for now
2 Views