Prisma1: prisma migration ambiguity

Created on 15 May 2019  路  4Comments  路  Source: prisma/prisma1

Describe the bug
Not sure if this is a bug, several bugs, or just something I'm doing wrong, but I made a video of what's happening.

https://youtu.be/ObvVXxn-GIY

I don't know how to reproduce this bug. It seems to just happen randomly after I make changes to the data model. I have no real way of knowing what changes caused it though. It seems to happen with completely unrelated changes to the datamodel.

Versions (please complete the following information):

  • Connector: MySQL
  • Prisma Server: 1.33
  • prisma CLI: 1.33.0
  • OS: Windows 10
kinquestion aredeploy

All 4 comments

@zwhitchcox

This can happen due to an unapplied migration. To mitigate this, you will need to access your database using a GUI and delete the last row of Migrations table the "prisma" database. Then run prisma deploy again.

For prisma admin bug, try removing rawAccess: true from your PRISMA_CONFIG

I deleted the past 5 migrations, and it's still giving me the same error. Also, all the migrations were marked SUCCESS

I've deleted 15 migrations, and it's still saying giving the same error.

type User @db(name: "user") {
  id: Int!
    @id(strategy: SEQUENCE)
    @sequence(name: "user_id_seq", initialValue: 1, allocationSize: 100)
  email: String! @unique
  password: String
  likedReviews: [Review!]! @relation(link: TABLE, name: "UserToLikedReview")
  reviews: [Review!]! @relation(link: TABLE, name: "ReviewToUser")
}

 type UserToLikedReview @db(name: "user_to_liked_review") @relationTable {
   user: User
   review: Review
 }
type Review @db(name: "review") {
  id: Int!
    @id(strategy: SEQUENCE)
    @sequence(name: "review_id_seq", initialValue: 1, allocationSize: 100)
  product: Product! @relation(link: INLINE, name: "ReviewToProduct")
  author: User @relation(link: INLINE, name: "ReviewToUser")
  usersLiked: [User!]! @relation(name: "UserToLikedReview")
}

I have the same problem when running prisma deploy. The error is The ambiguity is on a relation between User and Review. If I delete likedReviews field and UserToLikedReviews type, prisma deploy will works. I can't figure out how to solve this problem. It happens on production.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sedubois picture sedubois  路  3Comments

tbrannam picture tbrannam  路  3Comments

notrab picture notrab  路  3Comments

marktani picture marktani  路  3Comments

schickling picture schickling  路  3Comments