Skip to content

[Introspection] Identify Prisma 1 Id defaults #2499

@divyenduz

Description

@divyenduz

Problem

Prisma 1 IDs are introspected as Strings without a default/@default.

Suggested solution

Introspection can be improved following this logic:

  1. Is it a Prisma1 or Prisma11 classified database schema?
  2. Is there a primary key column of type char(25) or char(36)?
  3. If yes, apply the following default:
    • char(25) -> @default(cuid())
    • char(36) -> @default(uuid())

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions