Package and version
- prisma-next: 0.12.0
- @prisma-next/postgres: 0.12.0
- Node: v22.x
- Package manager: bun 1.3.x
- OS: macOS (darwin)
- Source DB: PostgreSQL 15 (local Supabase), FKs from
public → auth.users
What happened?
Against Supabase, infer output includes relation navigation fields pointing at a users model that was never inferred (auth schema excluded):
model Accounts {
id String @id
users users @relation(fields: [id], references: [id], onDelete: Cascade, map: "profiles_id_fkey")
// ...
}
model AdminNotes {
authorId String @map("author_id")
author users @relation(fields: [authorId], references: [id], onDelete: Cascade, map: "admin_notes_author_id_fkey")
// ...
}
There is no model users { … } in the inferred file. contract emit fails on the unresolved relation target.
What did you expect to happen?
Either:
- Infer
auth.users (or a documented stub/surface) when FKs reference it, or
- Omit relation navigation fields for cross-schema FKs and keep only the scalar FK column
Minimal reproduction
- Supabase project where e.g.
public.accounts.id FK → auth.users.id
prisma-next contract infer --db $DATABASE_URL scoped to / focused on public
- Output contains
users @relation lines but no model users
Workaround
Strip lines matching /\susers\??\s+@relation/ before contract emit.
Package and version
public→auth.usersWhat happened?
Against Supabase, infer output includes relation navigation fields pointing at a
usersmodel that was never inferred (auth schema excluded):There is no
model users { … }in the inferred file.contract emitfails on the unresolved relation target.What did you expect to happen?
Either:
auth.users(or a documented stub/surface) when FKs reference it, orMinimal reproduction
public.accounts.idFK →auth.users.idprisma-next contract infer --db $DATABASE_URLscoped to / focused onpublicusers @relationlines but nomodel usersWorkaround
Strip lines matching
/\susers\??\s+@relation/beforecontract emit.