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.
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):
prisma CLI: 1.33.0@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.