Prisma 1 Forum

Prisma:1.31 and mySQL support for UUID's as primary keys?

I loaded the latest prisma code thinking that finally we are getting UUID PK’s for mySQL and when I try to use them, I get the following error.

User
x– The field uuid is marked as id must have one of the following types: ID!,Int!.

type User {
uuid: UUID! @id(strategy: AUTO)
name: String!
}

The datamodel 1.1 docs https://www.prisma.io/docs/releases-and-maintenance/features-in-preview/datamodel-v11-b6a7/ say that

The @id directive can be applied to scalar fields of types:

  • ID
  • UUID
  • Int

So what is the reality?

@kshenes

We currently do not support UUID in MySQL. Only the postgresql connector supports it.
So you will need to provide it manually if you want to use UUID with mySQL

Then let’s say that in the Documentation

1 Like

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.