SQL Server: Unable to rename a column referenced by a relation #8539
Labels
bug/2-confirmed
Bug has been reproduced and confirmed.
kind/bug
A reported bug.
team/schema
Issue for team Schema.
tech/engines/migration engine
Issue in the Migration Engine
topic: sql server
Microsoft SQL Server
Milestone
Bug description
Renaming e.g. an id column that is referenced in a relation, will lead to a database error:
How to reproduce
Starting with the following data model, pushing it to the database:
Next, we rename the
id
field of theUser
model touId
, changing thereferences: [id]
toreferences: [uId]
in thePost
'sauthor
relation:Pushing this schema will lead to the error mentioned above.
Expected behavior
It should drop the key first, then create a new one.
Environment & setup
Prisma Version
latest master on 2.8.2021.
The text was updated successfully, but these errors were encountered: