You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When scaffolding a new migration with dnx ef migration add I lately end up with a Drop-/AddForeignKey for every FK in my schema. Everytime. Even if I just add migrations back to back without model changes inbetween.
I don't know if this has anything to do with the fact that I renamed ApplicationUser to AppUser and explicitely added an AppRole. It seems to coincide with the first time this happened in a migration.
Spent more time looking at the migrations and I think it's related to .OnDelete(DeleteBehavior.Cascade).
Unless .OnDelete(DeleteBehavior.Restrict) is specified, Up() is scaffolded as ReferentialAction.Cascade and Down() as .Restrict even if the FK was ON DELETE CASCADE.
When scaffolding a new migration with
dnx ef migration add
I lately end up with a Drop-/AddForeignKey for every FK in my schema. Everytime. Even if I just add migrations back to back without model changes inbetween.I don't know if this has anything to do with the fact that I renamed ApplicationUser to AppUser and explicitely added an AppRole. It seems to coincide with the first time this happened in a migration.
Here's the related part of my model:
The text was updated successfully, but these errors were encountered: