Prisma1: UUID type generates incorrect schema on MySQL

Created on 9 Aug 2018  ·  6Comments  ·  Source: prisma/prisma1

Describe the bug
The UUID field type creates columns to store binary UUIDs with the type CHAR(), which is not binary-safe as it depends on the encoding of the connection and database.

To Reproduce
Steps to reproduce the behavior:

  1. Do a prisma init and set up a new MySQL instance as normal.
  2. In the generated datamodel.graphql, change the default id field declaration to UUID! @unique.
  3. Run prisma migrate to deploy the schema.
  4. Run prisma playground and attempt to use a mutation query to create a new user.

Expected behavior
You should be able to use the UUID column as intended without insertion errors. Instead, you will get an error, and the Prisma server will report that the database threw an error for "Incorrect string value".

Screenshots
Screenshot showing Playground reporting error
docker-compose log output after error

Versions (please complete the following information):

  • OS: macOS High Sierra 10.13.6
  • prisma CLI: prisma/1.13.7 (darwin-x64) node-v10.8.0
  • Prisma Server: 1.13.7 (Docker)
bu1-repro-available

Most helpful comment

That will be fixed with our upcoming datamodel v1.1

All 6 comments

Just ran into the same issue 🤦‍♂️

This also occurs for me on development servers running 1.18-beta-1

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

Commenting to stop the issue being deleted

That will be fixed with our upcoming datamodel v1.1

We do not allow UUID with MySQL on id fields anymore.

We do have a separate bug that allows you to deploy UUID to non id fields on MySQL, that is being tracked here: https://github.com/prisma/prisma/issues/4344

I am closing this one, please feel free to open a new issue in case you feel strongly about it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AlessandroAnnini picture AlessandroAnnini  ·  3Comments

sedubois picture sedubois  ·  3Comments

tbrannam picture tbrannam  ·  3Comments

Fi1osof picture Fi1osof  ·  3Comments

marktani picture marktani  ·  3Comments