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), many uuid PK/FK columns
What happened?
contract infer emits a types block and uses named aliases throughout:
types {
AccountId = String @db.Uuid
SentAt = DateTime
// ...
}
model Accounts {
id AccountId @id
// ...
}
After contract emit, migration plan fails — fields using AccountId appear to end up with empty/incorrect typeParams on text/uuid codecs. Replacing aliases with base scalars (AccountId → String) and removing the types block fixes planning.
What did you expect to happen?
Inferred aliases should lower cleanly into contract.json with correct codec/typeParams, or infer should emit base scalars directly if aliases are not yet supported end-to-end.
Minimal reproduction
- Infer a schema with many
uuid PK/FK columns (Supabase-style)
contract emit on the inferred PSL (with types { … } intact)
- Run
migration plan (additive or brownfield)
- Compare with same contract after removing
types { … } and inlining String / DateTime
Workaround
Remove types { … } and replace alias names with String, DateTime, etc. before emit/plan.
Package and version
What happened?
contract inferemits atypesblock and uses named aliases throughout:After
contract emit,migration planfails — fields usingAccountIdappear to end up with empty/incorrecttypeParamson text/uuid codecs. Replacing aliases with base scalars (AccountId→String) and removing thetypesblock fixes planning.What did you expect to happen?
Inferred aliases should lower cleanly into
contract.jsonwith correct codec/typeParams, or infer should emit base scalars directly if aliases are not yet supported end-to-end.Minimal reproduction
uuidPK/FK columns (Supabase-style)contract emiton the inferred PSL (withtypes { … }intact)migration plan(additive or brownfield)types { … }and inliningString/DateTimeWorkaround
Remove
types { … }and replace alias names withString,DateTime, etc. before emit/plan.