Skip to content

Inferred types { } aliases break migration plan (empty typeParams on text/uuid) #784

@olgen

Description

@olgen

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 (AccountIdString) 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

  1. Infer a schema with many uuid PK/FK columns (Supabase-style)
  2. contract emit on the inferred PSL (with types { … } intact)
  3. Run migration plan (additive or brownfield)
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions