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
in your C# project folder where you have EF Core migrations
dotnet ef migrations add SecondVersion -o c:\temp
in the folder c:\temp we now have:
SecondVersion.cs
SecondVersion.designer.cs
MyDbContextModelSnapshot.cs
in the project folder nothing is changed
With EF Core 3.x I can rerun "dotnet ef migrations add SecondVersion" without the -o option and it will add the exact same migration to my project.
In EF Core 5.x the behavior is like this:
in your C# project folder where you have EF Core migrations
dotnet ef migrations add SecondVersion -o c:\temp
in the folder c:\temp we now have:
SecondVersion.cs
SecondVersion.designer.cs
in the project folder the model snapshot is changed
MyDbContextModelSnapshot.cs
With EF Core 5.x I can rerun "dotnet ef migrations add SecondVersion" without the -o option and it will add an empty migration to my project, because the model snapshot is already changed.
I expect the -o option to respect the output path and not to touch my local model snapshot file. This allows me to easily check my migration, change the code, redo, etc. until I'm satisfied with the outcome.
Run run-testcase.cmd in the sample project to see the behavior. EfCoreSample.zip
The text was updated successfully, but these errors were encountered:
Thanks for listing the alternatives. I guess I have to learn a new habit and undo the snapshot file when using the -o option. I can see the need for the #13342 fix in case you really want to use the -o option to place the migrations in a specific folder in your project.
File a bug
Up to EF Core 3.x the behavior was like this:
With EF Core 3.x I can rerun "dotnet ef migrations add SecondVersion" without the -o option and it will add the exact same migration to my project.
In EF Core 5.x the behavior is like this:
With EF Core 5.x I can rerun "dotnet ef migrations add SecondVersion" without the -o option and it will add an empty migration to my project, because the model snapshot is already changed.
I expect the -o option to respect the output path and not to touch my local model snapshot file. This allows me to easily check my migration, change the code, redo, etc. until I'm satisfied with the outcome.
Run run-testcase.cmd in the sample project to see the behavior.
EfCoreSample.zip
The text was updated successfully, but these errors were encountered: