Running db pull after upgrading to 3.x removed name from @@unique #9318
Labels
bug/1-unconfirmed
Bug should have enough information for reproduction, but confirmation has not happened yet.
kind/bug
A reported bug.
team/schema
Issue for team Schema.
topic: re-introspection
Milestone
Bug description
I had an existing unique constraint
@@unique([userId, url, uniqueId], name: "uniqueOrg")
and I wanted to keep the previously generated db name for this, and following the upgrade guide I rannpx prisma db pull
Expected Result:
@@unique([jetstreamUserId, jetstreamUrl, uniqueId], name: "uniqueOrg", map: "uniqueOrg")
Actual Result:
@@unique([jetstreamUserId, jetstreamUrl, uniqueId], map: "uniqueOrg")
I noticed because after running prisma generate, my code failed to compile because of a mis-named constraint.
How to reproduce
Start with version 2.3
Create a schema and add
@@unique
with a specific namepush all changes to db
upgrade to v 3.x
run
db pull
Expected behavior
The name should be retained
@@unique([jetstreamUserId, jetstreamUrl, uniqueId], name: "uniqueOrg", map: "uniqueOrg")
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: