Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mixing uuid's with strings #2784

Closed
ryands17 opened this issue Jun 17, 2020 · 3 comments · Fixed by #2824
Closed

mixing uuid's with strings #2784

ryands17 opened this issue Jun 17, 2020 · 3 comments · Fixed by #2824
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. tech/typescript Issue for tech TypeScript. topic: runtime-validation
Milestone

Comments

@ryands17
Copy link

Bug description

Prisma throws an error when mixing uuid's with plain strings

image

How to reproduce

  1. Schema
model User {
  id Int @id @default(autoincrement())
  values String[]
}
  1. Add data
const items = [
  'sample 1 string',
  '7fb1aef9-5250-4cf6-92c7-b01f53862822',
  'sample 3 string',
  '575e0b28-81fa-43e0-8f05-708a98d55c14',
  'sample 5 string',
]

 await prisma.user.create({
    data: {
      values: {
        set: items,
      },
    },
  })

Prisma throws the above error (screenshot)

Expected behavior

It should insert the strings correctly

Environment & setup

  • OS: Debain
  • Database: Postgres
  • Prisma version: 2.0.0
  • Node.js version: 12.17.0
@pantharshit00 pantharshit00 added bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. tech/typescript Issue for tech TypeScript. topic: runtime-validation labels Jun 17, 2020
@pantharshit00
Copy link
Contributor

I can confirm this issue, thanks for the detailed report.

@chrisdrackett
Copy link

thanks so much @ryands17!

@timsuchanek
Copy link
Contributor

Thanks a lot for reporting 🙏
This issue is fixed in the latest dev version of @prisma/cli.
You can try it out with npm i -g @prisma/cli@dev.

In case it’s not fixed for you - please let us know and we’ll reopen this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. tech/typescript Issue for tech TypeScript. topic: runtime-validation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants