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

Model named "@@id" #806

Closed
SMasiu opened this issue Nov 27, 2021 · 3 comments
Closed

Model named "@@id" #806

SMasiu opened this issue Nov 27, 2021 · 3 comments
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug.
Milestone

Comments

@SMasiu
Copy link

SMasiu commented Nov 27, 2021

Describe the bug
Seems that Prisma studio doesn't pick up the name given in the model

To Reproduce
Steps to reproduce the behavior:

  1. Create prisma model
model GroupMember {
  role Int
  groupId Int
  group    Group  @relation(fields: [groupId], references: [id])
  userId Int
  user   User @relation(fields: [userId], references: [id])
  
 @@id([groupId, userId], name: "primaryKey")
}
  1. Open Prisma studio
  2. Update role

Error message
Invalid prisma.groupMember.update() invocation:

{
  where: {
    groupId_userId: {
    ~~~~~~~~~~~~~~~~
      groupId: 1,
      userId: 3
    }
  },
  data: {
    role: 1
  }
}
@SMasiu SMasiu added the topic: hosted data browser It's about cloud.prisma.io label Nov 27, 2021
@eemmiillyy eemmiillyy self-assigned this Dec 27, 2021
@sdnts
Copy link
Contributor

sdnts commented Dec 27, 2021

Hey @SMasiu, apologies for the late response here, but we've been able to reproduce this. I'll let you know when a fix is out!

@sdnts sdnts added bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. and removed topic: hosted data browser It's about cloud.prisma.io labels Dec 27, 2021
@sdnts sdnts closed this as completed Dec 29, 2021
@sdnts sdnts reopened this Dec 29, 2021
@sdnts
Copy link
Contributor

sdnts commented Jan 6, 2022

This should be fixed on the latest Prisma CLI dev version (3.8.0-dev.46 as of writing). Could you update your CLI and let me know if you're still seeing this?
This will make it to the stable CLI with the next release (next Tuesday). You can keep using the dev version if you'd like, but I'd recommend upgrading to 3.8.0 when it goes out, since dev versions are mostly for internal use and may contain unannounced breaking changes.

Let me know if you're still seeing this!

@sdnts sdnts closed this as completed Jan 6, 2022
@sdnts sdnts added this to the 3.8.0 milestone Jan 6, 2022
@SMasiu
Copy link
Author

SMasiu commented Jan 6, 2022

I've upgraded Prisma to 3.8.0-dev.46 version and I'm not getting this error anymore.

Thanks, guys for fixing that bug.

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.
Projects
None yet
Development

No branches or pull requests

3 participants