Closed matthewmueller closed 3 years ago
Also removing a default value fails:
model User {
id Int @id @default(autoincrement())
name String @default("Musti")
}
to
model User {
id Int @id @default(autoincrement())
name String?
}
gives us an error
Caused by:
0: Database error: Error querying the database: ''DF__User__name__36B12243' is not a constraint.' on server 8c638ed057de executing on line 2 (code: 3728, state: 1, class: 16)
Keeping the candidate label so that you can discuss it in your planning @pimeys @matthewmueller - for us to make sense to tackle it this sprint.
@albertoperdomo it's already been fixed in a PR. We just need to talk a bit more about possible issues with the shadow database, and randomized constraint names. Hopefully there will be no other problems than these two.
Bug description
Trying to remove a model with a foreign key on a database without data, lands me in a permanently broken state on SQL Server.
How to reproduce
Previous
Current
Puts me in a permanently broken state. I need to manually adjust my SQL scripts to remove the migration.
Expected behavior
This should work as expected.
Environment & setup