Foreign key from Prisma table to auth.users

Hello!

When I run this sql query, I get an error:
ALTER TABLE "User" ADD FOREIGN KEY ("id") REFERENCES "auth"."users"("id");


results in:
Failed to run sql query: foreign key constraint "User_id_fkey" cannot be implemented


I think the error may be on prisma, is this something that cannot be done?

The goal here is that I want to delete a db entry when an auth user is deleted -> perhaps a trigger is more appropriate?

Thanks!
Was this page helpful?