Skip to content

mixing uuid's with strings #2784

@ryands17

Description

@ryands17

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions